Skip to content

Deploy my back office on a server

Your back office can run on your local environment, but in most cases, your application is meant to be accessible online. To do this, after acquiring a VPS or a dedicated server, you will then have the opportunity to install the back office and its dependencies on your server. You can then choose to install it manually or via Kamal.

Manual Installation

First, you need to install Docker on your server. You can find all the commands needed for a complete installation in the official tutorial (for Debian). It is also possible to install Docker in a single command using the official script:

shell
curl -fsSL https://get.docker.com | sudo sh

In order to manage Docker as a non-root user, it is recommended to follow the post-installation instructions and execute the following commands:

shell
sudo groupadd docker
sudo usermod -aG docker $USER
newgrp docker

Finally, all that remains is for you to follow the instructions in the getting started guide to install the Docker image.

Install via Kamal

When your back office is available locally, you can also deploy it online with a single command using Kamal. To do this, however, you need to provide several environment variables:

VariableDescription
SERVER_HOSTThe address of your server, for example 192.168.0.1
ENABLE_SSLEnable or disable HTTPS support
PROXY_HOSTThe domain name of your application, for example back-office.pro
SSH_USERThe SSH user, by default root

ℹ️

You do not need to specify PROXY_HOST if ENABLE_SSL is not provided.

Finally, you can run the command with the variables correctly specified:

shell
docker exec -it back-office-web \
            SERVER_HOST=192.168.0.1 \
            ENABLE_SSL=true \
            PROXY_HOST=back-office.pro \
            SSH_USER=deploy \
            bin/kamal setup