Skip to content

devlanes is in beta and not ready for production use.Report an issue

Give a server you run yourself a hostname

When you already run a server yourself, such as a docs site or pgAdmin, devlanes can give it an HTTPS hostname without starting or watching it.

This needs devlanes installed with HTTPS set up, as Install devlanes describes, and a look at A service, a port and a hostname helps.

devlanes reads a project file, devlanes.yaml, in the folder you run it from, a Git repository or a plain folder. For a server devlanes does not start, the file names the project and the address where your server listens:

devlanes.yaml
project: myapp
infra:
external:
docs:
address: 127.0.0.1:4800
hosts: "${{ lane.domain }}"

The hostname is the project name followed by .localhost, so this file gives myapp.localhost.

Run one start in the folder:

~/dev/myapp
$ devlanes start --no-ui

There is nothing to start, but the folder becomes a lane of the project and the proxy routes the hostname to port 4800. Open https://myapp.localhost: while your server runs, it answers; while it is down, the proxy shows an error page saying nothing listens.

The proxy lives in the daemon, and a daemon that a command started exits a while after the last command. To keep the hostname answering, run the daemon as a login service, as The daemon describes.

Put the entry in the local file, devlanes.local.yaml next to the project file, which stays out of Git. Keep personal changes out of Git covers it.

Some dev servers refuse a request whose Host header is not their own address. The mapping form of a hostname makes the proxy send the local address instead:

devlanes.yaml
infra:
external:
docs:
address: 127.0.0.1:4800
hosts:
host: "${{ lane.domain }}"
host_header: upstream