Skip to content

Self-Hosting

  • Docker and Docker Compose
  • Tailscale installed and connected on the host machine
  • A machine accessible to your Tailnet peers (e.g. Raspberry Pi 5, a home server, VPS with Tailscale)
  1. Clone the repository:
Terminal window
git clone https://github.com/crnobog69/zlikord.git
cd zlikord
  1. Copy the example environment file:
Terminal window
cp .env.example .env
  1. Edit .env with your settings:
API_ADDR=:8787
JWT_SECRET=your-secret-key-here
DATABASE_URL=postgres://zlikord:zlikord@db:5432/zlikord?sslmode=disable
  1. Start the stack:
Terminal window
docker compose up -d

The API will be available at http://<your-tailscale-ip>:8787.

VariableDescriptionDefault
API_ADDRServer listen address:8787
JWT_SECRETSecret key for signing JWT tokens(required)
DATABASE_URLPostgreSQL connection string(empty = in-memory store)
MESSAGE_ENCRYPTION_KEY32-byte base64/hex key for at-rest message encryption(optional)
SEN_CDN_SERVER_APISen CDN API key for avatar uploads(optional)
MESSAGE_RATE_BURSTMax messages in rate limit bucket5
MESSAGE_RATE_REFILL_PER_SECTokens refilled per second1

You can also run the server directly:

Terminal window
cd server
go build -o bin/zlikord-api ./cmd/api
./bin/zlikord-api

When DATABASE_URL is empty, the server uses an in-memory store — useful for testing, but data is lost on restart.

Zlikord uses PostgreSQL. Migrations are applied automatically on startup when DATABASE_URL is set.

To run PostgreSQL separately:

Terminal window
docker run -d \
--name zlikord-db \
-e POSTGRES_USER=zlikord \
-e POSTGRES_PASSWORD=zlikord \
-e POSTGRES_DB=zlikord \
-p 5432:5432 \
postgres:17

Zlikord is intended to be accessed only within your Tailnet. There is no need to expose ports publicly.

  1. Install Tailscale on the host machine.
  2. Run tailscale up and authenticate.
  3. Note your Tailscale IP (tailscale ip -4).
  4. Share that IP with your group — clients connect to http://<tailscale-ip>:8787.

For additional security, use Tailscale ACLs to restrict which devices can reach the server.