Skip to Content
For DevelopersDeployment

Deployment

This guide covers deploying Auktiva to various environments.

Deployment Options

PlatformDatabaseStorageDifficulty
VPS with PM2SQLite or TursoLocal or S3Easy
DockerSQLite or TursoLocal or S3Easy
VercelTurso onlyS3 onlyEasy

Serverless platforms (Vercel, Netlify) require Turso database and S3 storage. SQLite and local storage won’t work due to ephemeral filesystems.

The easiest way to deploy Auktiva is using Docker with the included docker-compose.yml.

Prerequisites

  • Docker and Docker Compose installed
  • A domain name (optional, for HTTPS)

Quick Start

# Clone the repository git clone https://github.com/thomsa/auktiva.git cd auktiva # Create environment file cp .env.example .env # Generate secrets AUTH_SECRET=$(openssl rand -base64 32) SOKETI_APP_KEY=$(openssl rand -hex 16) SOKETI_APP_SECRET=$(openssl rand -hex 32) # Edit .env with your settings nano .env

Environment Variables

See Environment Variables for a complete reference of all configuration options.

Minimum required for Docker:

# Authentication (REQUIRED) AUTH_SECRET="your-generated-secret" AUTH_URL="https://auctions.yourdomain.com" # Realtime (optional but recommended) NEXT_PUBLIC_REALTIME_DRIVER="soketi" NEXT_PUBLIC_SOKETI_APP_KEY="your-generated-key" SOKETI_APP_SECRET="your-generated-secret" NEXT_PUBLIC_SOKETI_HOST="auctions.yourdomain.com"

Start with Docker Compose

# Build and start all services docker compose up -d # View logs docker compose logs -f # Stop services docker compose down

This starts:

  • auktiva - The main application on port 3000
  • soketi - WebSocket server for realtime features on port 6001

Data Persistence

Docker volumes are used to persist data:

  • auktiva-data - SQLite database
  • auktiva-uploads - Uploaded images
  • auktiva-logs - Application logs

Building Manually

If you prefer to build the image manually:

# Build the image docker build -t auktiva . # Run the container docker run -d \ --name auktiva \ -p 3000:3000 \ -e AUTH_SECRET="your-secret" \ -e AUTH_URL="http://localhost:3000" \ -e DATABASE_URL="file:./data/auktiva.db" \ -v auktiva-data:/app/data \ -v auktiva-uploads:/app/public/uploads \ auktiva

VPS Deployment (PM2)

Deploy directly to a VPS without Docker using PM2 process manager.

Step 1: Install Dependencies

# Install Node.js 20 curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - sudo apt install -y nodejs # Install PM2 globally sudo npm install -g pm2

Step 2: Clone and Setup

git clone https://github.com/thomsa/auktiva.git cd auktiva npm ci npm run setup

Step 3: Build and Start

npm run build pm2 start ecosystem.config.js pm2 save pm2 startup

Nginx Reverse Proxy

For both Docker and PM2 deployments, use Nginx as a reverse proxy.

Main Application

server { listen 80; server_name auctions.yourdomain.com; location / { proxy_pass http://localhost:3000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_cache_bypass $http_upgrade; } }

WebSocket Server (Soketi)

Soketi requires a separate subdomain for WebSocket connections:

server { listen 80; server_name ws.auctions.yourdomain.com; location / { proxy_pass http://localhost:6001; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_read_timeout 86400; } }

Then set NEXT_PUBLIC_SOKETI_HOST="ws.auctions.yourdomain.com" in your .env.

Enable HTTPS

sudo apt install certbot python3-certbot-nginx sudo certbot --nginx -d auctions.yourdomain.com -d ws.auctions.yourdomain.com

Vercel Deployment

Vercel requires Turso database and S3 storage due to its serverless nature.

  1. Push your code to GitHub
  2. Import project in Vercel Dashboard
  3. Set environment variables (see Configuration)
  4. Deploy

The repository’s vercel.json sets the build command to prisma generate && npx tsx scripts/migrate-turso.ts && npx tsx prisma/seed-currencies.ts && next build. Every Vercel build therefore applies pending migrations to the Turso database in DATABASE_URL, and seeds currencies when that table is empty, before it runs next build. The previous deployment keeps serving until the new one is live. vercel.json also turns off Git deployments, so production deploys come from the deploy hook that the tag workflow (.github/workflows/vercel-release.yml) calls. See Upgrading for release-specific steps.

Rate limiting uses in-memory storage which doesn’t work reliably on Vercel. Consider using Upstash Redis for production rate limiting.

Releasing

Maintainers cut releases of the hosted instance with the release script:

npm run release -- <patch|minor|major|X.Y.Z> [--dry-run]

The script fetches origin (including tags) and refuses to continue unless:

  • the working tree is clean, with no uncommitted changes or untracked files
  • HEAD is exactly origin/main. It works from a detached HEAD or a linked worktree, so git switch --detach origin/main is enough
  • the tag vX.Y.Z does not exist locally or on origin
  • an explicit X.Y.Z is a valid semantic version greater than the current version

It then sets the version in package.json and package-lock.json, commits chore: release vX.Y.Z, creates the annotated tag vX.Y.Z, and pushes both in one atomic push:

git push --atomic --no-follow-tags origin HEAD:refs/heads/main refs/tags/vX.Y.Z

The push updates both refs or neither. If it fails, the script prints how to retry it or how to undo the local commit and tag. --dry-run runs every check, including the fetch and the remote tag lookup, and prints the next version and the exact commands without changing anything. Pass it after --. If npm takes --dry-run for itself (npm run release patch --dry-run), the script warns and still only does a dry run.

The push goes directly to refs/heads/main, so main’s GitHub rules must allow it. Rulesets that require pull requests or signed commits reject the push unless the person pushing has bypass rights, and the atomic push then publishes nothing.

The pushed tag starts two workflows:

  • Vercel Production Deploy on Tag (.github/workflows/vercel-release.yml) calls the app deploy hook, and the docs deploy hook when docs/ changed since the previous tag. Both hooks build the current head of main, not the tag, so the workflow fails unless the tag commit is the head of origin/main. Main can still move between that check and the Vercel build, so avoid merging to main while a release deploys.
  • Release (.github/workflows/release.yml) publishes the release notes, generated with git-cliff, as a GitHub Release .

Release notes live in GitHub Releases. CHANGELOG.md is no longer updated.

Updates

Docker

cd /path/to/auktiva git pull docker compose build docker compose up -d

PM2

cd /path/to/auktiva git pull npm ci npm run build pm2 restart auktiva

Or use the built-in update system from Settings → Deployment Administration (see Deployment Admin).

Last updated on