How to override default HTTP and HTTPS ports on Docksal

Oleksii Chekulaiev
Docksal Maintainers Blog
2 min readJul 25, 2018

--

By default Docksal creates its own loopback IP address 192.168.64.100 for your localhost adapter, and listens on ports 80 and 443 of that IP. This is great, because it is not exclusive, you can have another web server running in parallel.

For instance if you want to have your own Apache or Nginx to run in parallel to Docksal, you should reconfigure them (configure Apache IP, configure Nginx IP) to listen on 127.0.0.1 instead of the default 0.0.0.0 and they will work just fine, as well as Docksal will.

However if you don’t have permissions or if some other web server does not support defining IP to bind to, then you can change the Docksal ports that docksal-vhost-proxy listens on.

To reconfigure default Docksal port, first, either manually add the lines below to $HOME/.docksal/docksal.env:

DOCKSAL_VHOST_PROXY_PORT_HTTP=8080
DOCKSAL_VHOST_PROXY_PORT_HTTPS=8443

Or do it using fin config command.

fin config set --global DOCKSAL_VHOST_PROXY_PORT_HTTP=8080
fin config set --global DOCKSAL_VHOST_PROXY_PORT_HTTPS=8443

After that, you need to reset the Docksal system:

fin system reset

This is it. Docksal’s vhost-proxy service will now listen on ports 8080 and 8443 of the 192.168.64.100 IP address while your other software can occupy ports 80 and 443 exclusively.

--

--