2024-04-15 01:33:02 +02:00
# Installation
2024-06-14 11:26:20 +02:00
## Requirements
2024-04-15 01:33:02 +02:00
2025-04-01 13:52:47 +02:00
- A Linux-based operating system. Kernel version `6.1` or later is recommended.
- Basic knowledge of Docker and Docker Compose.
2024-04-15 01:33:02 +02:00
2025-04-01 13:52:47 +02:00
Traditional "from-source" installation is not supported, as this software is designed to be run in a containerized environment. This guide will cover how to run the server using Docker.
2024-04-15 01:33:02 +02:00
2025-04-01 13:52:47 +02:00
## Installation
2024-04-15 01:33:02 +02:00
1. Download the `docker-compose.yml` file from the repository
2024-06-30 10:36:00 +02:00
> [!NOTE]
2025-04-01 13:52:47 +02:00
> You may need to change the image from `ghcr.io/versia-pub/server:latest` to `ghcr.io/versia-pub/server:main` if you want to use the latest changes from the `main` branch.
2024-06-30 10:36:00 +02:00
2024-04-15 01:33:02 +02:00
```bash
2025-04-01 13:52:47 +02:00
# Set this to "main" for the development build
TAG=v0.7.0
curl -o docker-compose.yml https://raw.githubusercontent.com/versia-pub/server/$TAG/docker-compose.yml
2024-04-15 01:33:02 +02:00
```
2025-04-01 13:52:47 +02:00
2. Edit the `docker-compose.yml` file to your liking, e.g removing the `db` service if you want to use an existing database.
3. Download the `config.example.toml` file from the repository
2024-04-15 01:33:02 +02:00
```bash
2025-04-01 13:52:47 +02:00
# This should be the same as the TAG variable above
TAG=v0.7.0
curl -o config.example.toml https://raw.githubusercontent.com/versia-pub/server/$TAG/config/config.example.toml
2024-04-15 01:33:02 +02:00
```
2025-04-01 13:52:47 +02:00
4. Edit the `config.example.toml` to your liking. You will at least need to change the `postgres` , `redis` and `http` sections to match your environment.
2024-04-15 01:33:02 +02:00
2024-06-14 11:42:24 +02:00
> [!WARNING]
2025-02-15 18:49:31 +01:00
> The first time you start the server, it will complain about missing keys in the configuration file.
>
> These will be autogenerated and printed to the console, so you can copy them to your `config.toml` file.
2024-06-14 11:42:24 +02:00
2025-04-01 13:52:47 +02:00
5. Run the following command to start the server:
2024-04-15 01:33:02 +02:00
```bash
2024-06-14 11:42:24 +02:00
docker compose up
2024-04-15 01:33:02 +02:00
```
You may need root privileges to run Docker commands.
2024-08-27 21:40:42 +02:00
To check server logs, run `docker compose logs versia` . The server will likely stop if there is an error, so you can check the logs to see what went wrong.
2024-06-14 11:42:24 +02:00
2025-04-01 13:52:47 +02:00
## Installing the frontend
The frontend is not included in the Docker image, so you will need to install it separately.
To do this, you may copy the static files from our frontend's Docker image:
```bash
# The frontend does not have a stable tag, so we use the main branch
TAG=main
OUTDIR=./frontend
TEMP=$(sudo docker create ghcr.io/versia-pub/frontend:$TAG)
sudo docker cp $TEMP:/app/public $OUTDIR
sudo docker rm $TEMP
```
> [!TIP]
>
> This command can be re-run to update the frontend to the latest version.
Then, set the following bind mount in your `docker-compose.yml` file:
```yaml
services:
versia:
...
volumes:
# If you set OUTDIR to a different directory, change this to match
# e.g. - ./custom-frontend:/frontend
- ./frontend:/frontend
```
Finally, update the config to point to the frontend:
```toml
[frontend]
path = "/frontend"
```
2024-06-14 11:26:20 +02:00
## Running the Server
2024-04-15 01:33:02 +02:00
Database migrations are run automatically on startup.
2024-11-10 15:24:34 +01:00
Please see the [CLI documentation ](../cli/index.md ) for more information on how to use the CLI.
2024-04-15 01:33:02 +02:00
2024-06-14 11:26:20 +02:00
## Updating the server
2024-04-15 01:33:02 +02:00
2025-02-15 18:49:31 +01:00
Updating the server is as simple as running `docker-compose pull` to update the Docker images, then `docker-compose up` to restart the server.
2024-04-15 01:33:02 +02:00
2025-01-23 15:28:16 +01:00
Sometimes, new configuration options are added to `config.example.toml` . If you see a new option in the example file, you should add it to your `config.toml` file.