GuidesMultiple servers
Run a second server
Give the second server its own data directory, name prefix, addresses and base domain.
# production (defaults: prefix ferry, API :7878, proxy :8080)
ferryd --data-dir /var/lib/ferry
# staging, on the same Docker daemon
ferryd --data-dir /var/lib/ferry-staging \
--name-prefix staging \
--api-addr 127.0.0.1:7879 \
--proxy-addr 0.0.0.0:8081 \
--base-domain staging.localhostEach server must have its own
| What | Option | Why |
|---|---|---|
| data directory | --data-dir | Its database, logs and certificates. The server that uses a data directory locks it. |
| name prefix | --name-prefix | Each Docker resource of the server has it. It must be unique for each daemon. |
| API address | --api-addr | Two servers cannot listen on the same port. |
| Proxy addresses | --proxy-addr, --https-addr | The same cause. Only one server can own ports 80 and 443. |
| base domain | --base-domain | Then their apps do not answer to the same hostnames. |
After the start
- Account. Each server has its own account, sessions and API tokens, in its own data directory. At its first start, the staging server prints its own
Create your accountlink, at its own API address:http://127.0.0.1:7879/setup?code=…. - Apps. The apps of the staging server are at
http://<name>.staging.localhost:8081. - Stop, status, logs.
ferryd stop,ferryd statusandferryd logsact on the server of the data directory that you name.
ferryd stop --data-dir /var/lib/ferry-stagingThis command stops staging and does not touch production.
Give the second server its own base domain (--base-domain staging.example.com). Put it behind a different port or another IP address.