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 .env

Edit .env and generate a secure BETTER_AUTH_SECRET:

openssl rand -hex 32

Start everything with the local-db profile:

docker compose --profile local-db up -d

The 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-token

Then start without the local-db profile:

docker compose up -d

Data 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-data

Platform Deployment (Dokploy / Coolify)

FeedElity can be deployed through PaaS platforms that support Docker Compose projects, such as Dokploy or Coolify.

  1. Connect your repository. Point the platform to your FeedElity fork or clone.
  2. Set the compose file. The platform should detect docker-compose.yml at the repository root.
  3. Configure environment variables. Add all required variables from the Environment Variables section below. Set BETTER_AUTH_URL and CORS_ORIGIN to your domain.
  4. Enable the local-db profile if needed. If you want the platform to run the libSQL container, make sure the local-db profile is active. Some platforms let you specify compose profiles in their UI.
  5. Set up TLS. Most platforms handle TLS termination automatically. Configure your domain and enable HTTPS.
  6. 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.

VariableDescriptionDefaultRequired
RUNTIME_MODEApplication runtime modeproductionNo
DATABASE_URLlibSQL connection string. Use http://db:8080 for local container, or a Turso cloud URL for externalhttp://db:8080Yes
BETTER_AUTH_SECRETSecret key for auth session encryption. Must be at least 32 characters. Generate with openssl rand -hex 32Yes
BETTER_AUTH_URLPublic URL where the app is accessible. Used by better-auth for cookie domain and redirectshttp://localhostYes
CORS_ORIGINAllowed origin for CORS requests. Must match the public URL of your deploymenthttp://localhostYes
PORTInternal port for the Hono API server3002No
NODE_ENVNode environment. Set to production for deploymentproductionNo
WEB_PORTExternal port exposed by the nginx web container80No

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 -d

Turso 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-token

Any 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 -d

If you are building from source instead of using pre-built images, pull the latest code first:

git pull
docker compose build
docker compose up -d

Database schema changes are applied through Drizzle migrations. If a release includes schema changes, run:

bun run db:migrate

Backup

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).