Pre-requisites
- A Linux server (x86) with Docker and Docker Compose installed
- Two domain names (or subdomains) pointing to your server’s IP address:
- One for the API (e.g.,
api.yourdomain.com) - One for the UI (e.g.,
app.yourdomain.com)
- One for the API (e.g.,
- Ports 80 and 443 open on your server
The last step is easy to forget! Do it right when you spin up your instance to prevent yourself from spending time debugging later.
DNS Configuration
Before running the deployment, ensure the following DNS records are configured:- Create an A record for your API domain pointing to your server’s IP address
- Create an A record for your UI domain pointing to your server’s IP address
If you are using CloudFlare to manage your DNS, make sure to disable the ‘Proxied’ option. A proxied record will not work with our Traefik configuration.
Deployment
Clone the Skald repo:- Prompt you for your API and UI domain names.
- Request an email address (required for Let’s Encrypt SSL certificates).
- Prompt you for the environment variables required to run Skald (e.g. API keys). Check out the Configuration section on the Intro page if you want to understand these better.
- Verify your DNS configuration.
- Generate secure credentials (e.g. Django’s SECRET_KEY, Postgres password).
- Set up a .env.prod file to be used when deploying the stack.
Managing Your Deployment
View logs
Stop the deployment
Restart the deployment
Update the deployment
To update to the latest version:What Gets Deployed
The deployment includes:- Traefik: Reverse proxy with automatic SSL certificate generation.
- PostgreSQL with pgvector: Our database.
pgvectorsupport is needed for vector embeddings. - RabbitMQ: Used for communicating between the Django server and the Memo Processing Server.
- API: The main Skald API Django server.
- Memo Processing Server: Background worker for processing memos.
- UI: The web interface.
Configuration
All configuration is stored in.env.prod, which is automatically generated by the deployment script. This file contains:
- Domain names
- Database credentials
- API keys
- Security secrets
SSL Certificates
SSL certificates are automatically generated and renewed by Let’s Encrypt through Traefik. The certificates are stored in a Docker volume (traefik-certificates) and will auto-renew before expiration.
Troubleshooting
SSL certificate issues
If you’re having trouble with SSL certificates:- Ensure ports 80 and 443 are open
- Verify DNS records are pointing to the correct IP
- Check Traefik logs:
docker compose -f docker-compose.selfhosted.yml logs traefik - Wait a few minutes — certificate generation can take some time
Service won’t start
- Check service logs:
docker compose -f docker-compose.selfhosted.yml logs <service-name> - Ensure all required environment variables are set in
.env.prod
Cannot connect to API
- Verify DNS is resolving correctly:
dig your-api-domain.com - Check API logs:
docker compose -f docker-compose.selfhosted.yml logs api - Ensure Traefik is running:
docker compose -f docker-compose.selfhosted.yml ps traefik