Can't access locally using docker with different port

I installed frappe in ubuntu machine using docker by following the github steps. The only think I changed in the docker-compose.yml file is the port number. I changed it to 9002 instead of 9000. Bcz 9000 port is already used by other service. I wanted to self host this application.

docker compose yml file content :

version: “3.7”
services:
mariadb:
image: mariadb:10.8
command:

  • –character-set-server=utf8mb4
  • –collation-server=utf8mb4_unicode_ci
  • –skip-character-set-client-handshake
  • –skip-innodb-read-only-compressed # Temporary fix for MariaDB 10.6
    environment:
    MYSQL_ROOT_PASSWORD: 123
    volumes:
  • mariadb-data:/var/lib/mysql

redis:
image: redis:alpine

frappe:
image: frappe/bench:latest
command: bash /workspace/init.sh
environment:

  • SHELL=/bin/bash
    working_dir: /home/frappe
    volumes:
  • .:/workspace
    ports:
  • 8000:8000
  • 9002:9002

volumes:
mariadb-data:

Other docker services are also running with their own databases . docker ps :
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
2c7bd5053bce mariadb:10.8 “docker-entrypoint.s…” 13 minutes ago Up 13 minutes 3306/tcp frappe_helpdesk-mariadb-1
88c0885bbaf8 redis:alpine “docker-entrypoint.s…” 13 minutes ago Up 13 minutes 6379/tcp frappe_helpdesk-redis-1
5f3b53e3f2e9 redis:6.2-alpine “docker-entrypoint.s…” 16 minutes ago Up 16 minutes 6379/tcp helpdesk_prod_setup-redis-cache-1
2b518877f088 redis:6.2-alpine “docker-entrypoint.s…” 16 minutes ago Up 16 minutes 6379/tcp helpdesk_prod_setup-redis-queue-1
078336511c2e mariadb:11.8 “docker-entrypoint.s…” 16 minutes ago Up 16 minutes (healthy) 3306/tcp helpdesk_prod_setup-db-1

I tried to access by : localhost:8000

But no page is loading.

Have you created site in bench?
if not, create a site like abc.localhost in bench and then you can assess using abc.localhost:8000

No. How do I do that ? what should I change in docker-compose.yml file ?

Also init.sh file is already there in the directory where docker-compose.yml file exist. I didn’t do anything with init.sh file. I thought docker-compose.yml file will do what needs to done with the init.sh.
Should I run that file mannually ?

@mohammedshan
No you don’t have to change in docker-compose.yml file
You can refer this for setup

except I can change the port . Right ?
I will watch the youtube video . Thank you. I will share here If I come across any problem.

Please check the video attached in the google drive link : https://drive.google.com/file/d/1KbGl7IvK5gdKgxkTJtwZQBbc1I83ioff/view?usp=sharing

As I was following the youtube instructions. I Couldn’t install it. Changed the ports (9003) in devcontainer.json and compose.yml . What to do next. In the youtube video, the user is setting up with default port.

I this This the permission issue.
Create User group and give permission, I thing that is cover in that video.
Install frappe from link that is given in description.

You don’t need to change any port or something in compose.yml file.
Try this and let me know weather it is working or not.

1 Like

I did clone frappe from the youtube description . And it-tools is already running in the system which is using port 9000 . There are other docker services that are running too. That’s why changed the ports in the compose.yml and devcontainer.json . Now I have done :

sudo groupadd docker

sudo usermod -aG docker $USER

newgrp docker

And then reopen in vscode with : code .
Asked for reopen the container. And I clicked. Still the same warning is shows. Should I page the error here ?

Try the same things after restarting you laptop.
Might be work

its the ubuntu server brother. Other services are running in the background. I just tried in another ubuntu machine, it passed that step with the default ports. Can you tell me if I want to change the port from 9000 to something, where should I change . I mean what files ?

Stopped all the services in the ubuntu system. changed every configurations to default. Now there is a new error :

I don’t see and error here

Just open any of the two urls as in the logs in your browser.make sure you have used bench use site.name

it worked. Thank you for the support