Nginx Proxy Manager
How to expose Drivebase through Nginx Proxy Manager using a shared Docker network
This guide covers setting up Drivebase behind Nginx Proxy Manager (NPM) using a shared Docker network. This is the recommended approach for self-hosters who already run NPM on the same machine.
How it works
Drivebase's container runs an internal Caddy server on port 8900. Instead of exposing that port to the host, you connect both containers to a shared Docker network so NPM can reach Drivebase by container name.
Browser → NPM (443/80) → Docker network → drivebase_app:89001. Create a shared Docker network
docker network create npm-proxy2. Connect NPM to the network
If your NPM container is managed by Docker Compose, add the external network to its compose.yaml:
# your existing NPM compose.yaml
networks:
npm-proxy:
external: trueThen add npm-proxy to NPM's service networks and recreate the container:
docker compose up -dIf you run NPM as a standalone container, connect it directly:
docker network connect npm-proxy <your-npm-container-name>3. Update Drivebase's compose.yaml
Two changes are needed on the app service: remove the ports mapping and add the shared network.
Remove the host port binding:
# Remove or comment out this block
ports:
- "8900:8900"Add the shared network to the app service and declare it at the bottom:
services:
app:
# ... existing config ...
networks:
- internal
- npm-proxy # add this
networks:
internal:
npm-proxy:
external: true # add this blockApply the changes:
docker compose up -d4. Add a Proxy Host in NPM
- Open Nginx Proxy Manager at
http://<your-server-ip>:81. - Go to Proxy Hosts → Add Proxy Host.
- Fill in the Details tab:
- Domain Names:
drivebase.example.com - Scheme:
http - Forward Hostname / IP:
drivebase_app(the container name) - Forward Port:
8900 - Enable Websockets Support
- Domain Names:
- In the Advanced tab, add the following custom config to support large file uploads and SSE:
client_max_body_size 10G;
proxy_read_timeout 3600s;
proxy_send_timeout 3600s;- On the SSL tab, request a Let's Encrypt certificate and enable Force SSL.
- Click Save.
5. Set APP_URL
Make sure APP_URL in your environment matches your public domain exactly (including https://). This is required for OAuth callbacks and passkey registration to work correctly.
APP_URL: https://drivebase.example.comVerify
Visit https://drivebase.example.com — you should see the Drivebase login page. If you see a 502, double-check that:
- Both containers are on the
npm-proxynetwork (docker network inspect npm-proxy) - The forward hostname in NPM matches the container name exactly (
drivebase_app) - The Drivebase container is healthy (
docker compose ps)