mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 08:28:19 +01:00
Some checks failed
CodeQL Scan / Analyze (javascript-typescript) (push) Failing after 5s
Build Docker Images / lint (push) Failing after 10s
Build Docker Images / check (push) Failing after 10s
Build Docker Images / tests (push) Failing after 6s
Build Docker Images / build (server, Dockerfile, ${{ github.repository_owner }}/server) (push) Has been skipped
Build Docker Images / build (worker, Worker.Dockerfile, ${{ github.repository_owner }}/worker) (push) Has been skipped
Deploy Docs to GitHub Pages / build (push) Failing after 5s
Deploy Docs to GitHub Pages / Deploy (push) Has been skipped
Mirror to Codeberg / Mirror (push) Failing after 0s
Nix Build / check (push) Failing after 5s
57 lines
2.4 KiB
Markdown
57 lines
2.4 KiB
Markdown
# 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.
|
|
|
|
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.
|