How to Change Ports on Multica Self-Hosted Localhost

3 min read.
Tags: devopsai

Multica self-hosted defaults to ports that every other dev tool also wants: frontend on 3000 and backend on 8080. My main work project already runs on localhost:3000, so Multica had to move somewhere else. Here's how to change the ports without touching the Docker images.

Quick answer

Set the host ports in Multica's .env, restart the stack, and point the CLI at the new URLs:

# .env
PORT=8765
FRONTEND_PORT=4321
make selfhost-stop && make selfhost
multica setup self-host --server-url http://localhost:8765 --app-url http://localhost:4321

Step 1: Edit .env

Open .env in the Multica repo root and change the two host ports:

PORT=8765
FRONTEND_PORT=4321

PORT is the backend, FRONTEND_PORT is the web app. Pick anything that doesn't clash with your other projects.

These are host ports only. Inside Docker, the containers still listen on 8080 and 3000, so you don't need to rebuild anything.

Also check FRONTEND_ORIGIN. In the default .env.example it's http://localhost:${FRONTEND_PORT}, so it follows the new port automatically. If you hardcoded it earlier, update it too, or login will fail on CORS.

Step 2: Restart the stack

make selfhost-stop && make selfhost

Docker Compose reads .env on start, so the new ports apply right away.

Step 3: Point the CLI at the new ports

multica setup self-host assumes 8080 and 3000. Pass the new URLs explicitly:

multica setup self-host --server-url http://localhost:8765 --app-url http://localhost:4321

This updates the CLI config, opens the browser to log in, and restarts the daemon.

Verify it works

curl http://localhost:8765/health

You should get a healthy response from the backend. Then open http://localhost:4321. You should land on the Multica login page.

What about PostgreSQL on 5432?

In self-host mode you don't need to change it. docker-compose.selfhost.yml doesn't publish Postgres to your machine at all. The backend talks to it over the Docker network, so it can't clash with a local Postgres.

It only matters if you run Multica's dev setup with docker-compose.yml, which binds 127.0.0.1:5432:5432. If that clashes, change the host side of the binding and match POSTGRES_PORT and DATABASE_URL in .env:

ports:
  - "127.0.0.1:${POSTGRES_PORT:-5499}:5432"

Conclusion

To change ports on Multica self-hosted, set PORT and FRONTEND_PORT in .env, restart with make selfhost, and rerun multica setup self-host with --server-url and --app-url. Postgres can stay as it is unless you're on the dev compose file.