Skip to content

docs: add self-hosting guide for Tux with Docker and Postgres #724

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions docs/self-hosting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Getting started with self-hosting Tux

Check notice on line 1 in docs/self-hosting.md

View check run for this annotation

Trunk.io / Trunk Check

markdownlint(MD022)

[new] Headings should be surrounded by blank lines

Check failure on line 1 in docs/self-hosting.md

View check run for this annotation

Trunk.io / Trunk Check

prettier

Incorrect formatting, autoformat by running 'trunk fmt'
> [!WARNING]
> This guide is for Docker with Docker Compose. This also assumes you have a working Postgres database. If you don't have one, you can use [Supabase](https://supabase.io/).

## Prerequisites

Check notice on line 5 in docs/self-hosting.md

View check run for this annotation

Trunk.io / Trunk Check

markdownlint(MD022)

[new] Headings should be surrounded by blank lines
- Docker and Docker Compose

Check notice on line 6 in docs/self-hosting.md

View check run for this annotation

Trunk.io / Trunk Check

markdownlint(MD032)

[new] Lists should be surrounded by blank lines
- A working Postgres database and the URL in the format `postgres://[username]:[password]@host:port/database`. For Supabase users, ensure you use the provided pooler URL in the same format.
- Discord bot token with intents enabled
- Sentry URL for error tracking (optional)

## Steps to Install

Check notice on line 11 in docs/self-hosting.md

View check run for this annotation

Trunk.io / Trunk Check

markdownlint(MD022)

[new] Headings should be surrounded by blank lines
1. Clone the repository

Check notice on line 12 in docs/self-hosting.md

View check run for this annotation

Trunk.io / Trunk Check

markdownlint(MD032)

[new] Lists should be surrounded by blank lines

```bash
git clone https://github.com/allthingslinux/tux && cd tux
```

2. Copy the `.env.example` file to `.env` and fill in the required values.

3. Copy the `config/settings.yml.example` file to `config/settings.yml` and fill in the required values.

4. Start the bot

```bash
docker-compose up -d
```

> [!NOTE]
> Add `--build` to the command if you want to use your local changes.

5. Check the logs to see if the bot is running

```bash
docker-compose logs
```

6. Push the database schema

```bash
docker exec -it tux prisma db push
```

> [!NOTE]
> If this gets stuck your database URL is most likely incorrect. Please check the URL (port as well, port is usually 5432). You should give the command 30 seconds to run before you assume it's stuck.

7. Run `(prefix)help` in your server to see if the bot is running. If it is, now you can start configuring the bot.