Multiple instances on a server
Several users will find themselves wanting to run multiple instances of OliveTin. Depending on how you’ve setup OliveTin depends on how easy it is to configure that. This page includes instructions for OliveTin installed as a container, and as a package (.tar.gz).
With Containers
This is the easiest way to run multiple OliveTin instances. Follow the Container Installation instructions, or similar for Docker Compose, Helm or similar to get started.
-
Create a
config.yaml
file for each instance of OliveTin (instances cannot share the same config). -
Choose a new external port for OliveTin and set it in the config file (by default that is
1337
is used). For example, setlistenAddressSingleHTTPFrontend: 0.0.0.0:2337
for your 2nd container’s config. -
When creating the container, pass in the 2nd instance’s config, eg;
-v /opt/OliveTin_two/:/config/
-
When creating the container, set the external port, eg:
2337:1337
- 2337 is the external port)
You do not need to change the listenAddresses / ports for the other 3 ports that OliveTin uses, when you are running inside a container.
Without containers - using a package (.tar.gz)
If you are not using containers, then it is probably best not to use a .deb/.rpm
installation, as those packages can only be installed for one instance.
Instead, follow the instructions for installing from a .tar.gz archive.
When you come to create the config.yaml file, OliveTin will look for this in it’s own startup directory. Therefore it is probably best to extract the .tar.gz file like this and change the paths;
-
/opt/OliveTin_one/
-
/opt/OliveTin_two/
-
/opt/OliveTin_three/
Because you are running outside of a container, you will also need to change the "internal" ports used by OliveTin so they are separate for all instances. OliveTin listens on 4 addresses (1 external, 3 internal) and needs 4 ports. You can read about these in the network ports documentation.
OliveTin also supports reading the PORT environment variable, and will use this as a base port for the simgle frontend, will add 1 to start extra servers. For example of PORT is 2000, then the simgle frontend will start on port 2000, the REST API on 2001, and so on. |
You could end up with a setup that looks like this;
Instance Name | Install path | Config file path | Single frontend point (listenAddressSingleHTTPFrontend ) |
REST Actions port (listenAddressRestActions ) |
gRPC Actions port (listenAddressGrpcActions ) |
WebUI Port (listenAddressWebUI ) |
---|---|---|---|---|---|---|
OliveTin_one |
|
|
|
|
|
|
OliveTin_two |
|
|
|
|
|
|
OliveTin_three |
|
|
|
|
|
|
Note that you will also need to adjust the default systemd service file to point to your install directory, if using that. Here is an example for OliveTin_two
;
[Unit]
Description=OliveTin2
[Service]
WorkingDirectory=/opt/OliveTin_two/
ExecStart=/opt/OliveTin_two/OliveTin
Restart=always
[Install]
WantedBy=multi-user.target