Skip to content

Caddy Recommended

Deploys Bearicorn with Caddy as the web server. Caddy automatically obtains and renews TLS certificates from Let's Encrypt — no manual certificate management required.

Requirements

Deployment

Step 1 - Download the required files

bash
sudo mkdir -p /opt/bearicorn
sudo chown "$USER":"$USER" /opt/bearicorn
cd /opt/bearicorn
git clone https://github.com/bybearicorn/monorepo.git
cd monorepo/deploy/compose

Step 2 - Populate the .env file

bash
cp .env.caddy .env

Generate secret values:

bash
openssl rand -hex 32  # use as JWT_SECRET
openssl rand -hex 16  # use as DB_PASSWORD

Open the file for editing:

bash
nano .env

Set the following values:

  • JWT_SECRET — paste the 64-character value generated above
  • DB_PASSWORD — paste the 32-character value generated above
  • CADDY_SITE_ADDRESS — your domain name (e.g. chat.yourcompany.com)
  • TZ — optional, your timezone (e.g. Europe/Berlin); defaults to UTC

WARNING

Do not leave JWT_SECRET and DB_PASSWORD at their default placeholder values on a live server.

Step 3 - Start the containers

bash
docker compose --env-file .env -f docker-compose.caddy.yml up --build -d

The first build takes 3–5 minutes. Caddy will automatically obtain the TLS certificate on startup.

Access the application

Navigate to https://your-domain.com.

The first user to register becomes the admin. Database migrations run automatically on first start.

INFO

Always access the application via the configured domain name. Caddy routes by Host header — requests to the raw server IP will not be served correctly.

Management

bash
# View logs
docker compose -f docker-compose.caddy.yml logs -f
docker compose -f docker-compose.caddy.yml logs caddy      # Caddy only
docker compose -f docker-compose.caddy.yml logs hub-app    # app only

# Check container status
docker compose -f docker-compose.caddy.yml ps

# Restart all containers
docker compose -f docker-compose.caddy.yml restart

# Stop all containers
docker compose -f docker-compose.caddy.yml down

# Update to the latest version
git pull && docker compose -f docker-compose.caddy.yml up --build -d