server/docs/setup/installation.md

57 lines
2.4 KiB
Markdown
Raw Normal View History

# Installation
## Requirements
- A Linux-based operating system. Kernel version `6.1` or later is recommended.
- Basic knowledge of Docker and Docker Compose.
## Installation
> [!INFO]
>
> Traditional "from-source" installation is not supported, as the server is designed to be run in a containerized environment. This guide will cover how to run the server using Docker.
>
> You may still run the server without Docker, but I can't guarantee that it will work properly.
1. Download the `docker-compose.yml` file from the repository
> [!NOTE]
> 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. Make sure to use the config template from the same branch as the server.
```bash
curl -o docker-compose.yml https://raw.githubusercontent.com/versia-pub/server/v0.7.0/docker-compose.yml
```
1. Edit the `docker-compose.yml` file to set up the database connection and other settings
2. Download the `config.example.toml` file from the repository
```bash
curl -o config.example.toml https://raw.githubusercontent.com/versia-pub/server/v0.7.0/config/config.example.toml
```
4. Edit the `config.example.toml` file to set up the database connection and other settings, rename it to `config.toml`, then place it inside `config/` (create the `config/` directory if it does not exist)
5. Run the following command to start the server:
> [!WARNING]
> 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.
```bash
docker compose up
```
You may need root privileges to run Docker commands.
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.
## Running the Server
Database migrations are run automatically on startup.
Please see the [CLI documentation](../cli/index.md) for more information on how to use the CLI.
## Updating the server
Updating the server is as simple as running `docker-compose pull` to update the Docker images, then `docker-compose up` to restart the server.
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.