Self-Hosting Guide
FeedElity is designed to be self-hosted. This guide covers deployment with Docker Compose, environment configuration, database options, platform deployment, backup, and updates.
Prerequisites
- A server running Linux (or any OS with Docker support)
- Docker Engine 20.10 or later
- Docker Compose v2 or later (included with Docker Desktop and modern Docker Engine)
- At least 512 MB RAM and 1 GB of disk space for the application; more if you run the local database container
Docker Deployment
With Local Database
The simplest setup runs a libSQL container alongside the app. This uses a Docker volume for data persistence.
git clone https://github.com/anomalyco/FeedElity.git
cd FeedElity
cp .env.docker.example .envEdit .env and generate a secure BETTER_AUTH_SECRET:
openssl rand -hex 32Start everything with the local-db profile:
docker compose --profile local-db up -dThe app will be available at http://localhost (port 80 by default, configurable via WEB_PORT).
With External Database
You can use Turso cloud or any libSQL-compatible server as your database. Set the DATABASE_URL environment variable to the external connection string.
In your .env file:
DATABASE_URL=libsql://your-db-name-your-org.turso.io?authToken=your-tokenThen start without the local-db profile:
docker compose up -dData Persistence
When using the local database container, FeedElity stores data in a Docker volume named libsql-data. This volume persists across container restarts and rebuilds.
To inspect the volume:
docker volume inspect FeedElity_libsql-dataPlatform Deployment (Dokploy / Coolify)
FeedElity can be deployed through PaaS platforms that support Docker Compose projects, such as Dokploy or Coolify.
- Connect your repository. Point the platform to your FeedElity fork or clone.
- Set the compose file. The platform should detect
docker-compose.ymlat the repository root. - Configure environment variables. Add all required variables from the Environment Variables section below. Set
BETTER_AUTH_URLandCORS_ORIGINto your domain. - Enable the local-db profile if needed. If you want the platform to run the libSQL container, make sure the
local-dbprofile is active. Some platforms let you specify compose profiles in their UI. - Set up TLS. Most platforms handle TLS termination automatically. Configure your domain and enable HTTPS.
- Deploy. The platform builds and starts the containers. The web service exposes port 80 by default (or
WEB_PORT).
Environment Variables
All configuration is done through environment variables. Copy .env.docker.example to .env as a starting point.
| Variable | Description | Default | Required |
|---|---|---|---|
| RUNTIME_MODE | Application runtime mode | production | No |
| DATABASE_URL | libSQL connection string. Use http://db:8080 for local container, or a Turso cloud URL for external | http://db:8080 | Yes |
| BETTER_AUTH_SECRET | Secret key for auth session encryption. Must be at least 32 characters. Generate with openssl rand -hex 32 | — | Yes |
| BETTER_AUTH_URL | Public URL where the app is accessible. Used by better-auth for cookie domain and redirects | http://localhost | Yes |
| CORS_ORIGIN | Allowed origin for CORS requests. Must match the public URL of your deployment | http://localhost | Yes |
| PORT | Internal port for the Hono API server | 3002 | No |
| NODE_ENV | Node environment. Set to production for deployment | production | No |
| WEB_PORT | External port exposed by the nginx web container | 80 | No |
Database Options
Local libSQL Container
Enabled with the --profile local-db flag. Data is stored in a Docker volume on the host. Good for single-server deployments. No external dependency.
docker compose --profile local-db up -dTurso Cloud
Set DATABASE_URL to your Turso connection string. Includes built-in backups, replication, and no local storage management.
DATABASE_URL=libsql://my-db-my-org.turso.io?authToken=your-tokenAny libSQL-Compatible Server
FeedElity works with any server that speaks the libSQL protocol. Point DATABASE_URL to your server endpoint.
Updating
Pull the latest images and restart the services:
docker compose pull
docker compose up -dIf you are building from source instead of using pre-built images, pull the latest code first:
git pull
docker compose build
docker compose up -dDatabase schema changes are applied through Drizzle migrations. If a release includes schema changes, run:
bun run db:migrateBackup
Local Database Backup
When using the local libSQL container, back up the Docker volume:
docker run --rm -v FeedElity_libsql-data:/data -v $(pwd):/backup alpine tar czf /backup/feedelity-db-backup-$(date +%Y%m%d).tar.gz -C /data .To restore from a backup:
docker run --rm -v FeedElity_libsql-data:/data -v $(pwd):/backup alpine sh -c "cd /data && tar xzf /backup/feedelity-db-backup-YYYYMMDD.tar.gz"Turso Cloud Backup
Turso handles backups automatically. You can also create manual snapshots through the Turso CLI or dashboard. Refer to the Turso documentation for details.
Architecture Overview
The Docker Compose setup runs three services:
- web — Nginx serving the static Solid frontend. Proxies
/rpc/and/api/requests to the server service. - server — Bun runtime hosting the Hono API server with oRPC procedures and better-auth.
- db — libSQL server container (optional, only started with the local-db profile).
Nginx handles static asset caching with 1-year expiry, gzip compression, and security headers (X-Frame-Options, X-Content-Type-Options, X-XSS-Protection, Referrer-Policy).