I’m trying to run Metabase in Docker on a GCP VM that already hosts a Laravel application served by Apache. I want:
Laravel app accessible on / (e.g., http:///)
Metabase accessible on /metabase (e.g., http:///metabase)
Docker port 3000 not exposed publicly (only via Apache proxy)
What I’ve done
Docker container is running Metabase locally:
sudo docker run -d -p 3000:3000
-e MB_SITE_URL="http://127.0.0.1/metabase"
--name metabase metabase/metabase
Verified with:
sudo docker ps
curl http://127.0.0.1:3000
→ HTML output from Metabase appears.
Apache reverse proxy configuration (/etc/apache2/sites-available/metabase.conf):
<VirtualHost *:80>
ServerAdmin [email protected]
ProxyPreserveHost On
ProxyRequests Off
ProxyPass /metabase http://127.0.0.1:3000/
ProxyPassReverse /metabase http://127.0.0.1:3000/
ErrorLog ${APACHE_LOG_DIR}/metabase_error.log
CustomLog ${APACHE_LOG_DIR}/metabase_access.log combined
</VirtualHost>
Enabled modules and site:
sudo a2enmod proxy
sudo a2enmod proxy_http
sudo a2ensite metabase.conf
sudo systemctl reload apache2
Laravel site config (000-default.conf) remains unchanged:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/public
<Directory /var/www/html/public>
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
What I see
curl http://127.0.0.1/metabase → Metabase HTML works ✅
Browser http://<VM-IP>/ → Laravel login works ✅
Browser http://<VM-IP>/metabase → Laravel 404 page ❌
I do not want Metabase to be exposed directly on port 3000
Question
Why is Apache serving the Laravel 404 page instead of proxying /metabase to Docker, even though Docker is running and curl works locally?
How can I configure Apache so that:
Laravel app stays on /
Metabase is served securely on /metabase
Docker port 3000 remains internal