← All articles
Self-hostingDeployment

Deploy Paperclip with Coolify

Coolify is an open-source self-hosted PaaS — a Heroku/Render alternative you run on your own server. Once Coolify is running, deploying Paperclip (and anything else) becomes a visual, one-click operation with automatic SSL and git integration.

Deploy on Railway instead →

Why use Coolify for Paperclip

Coolify gives you the managed platform experience on your own hardware. Instead of configuring nginx and certbot manually for every service, Coolify handles it through a web UI. You still own the server, but deployments feel more like Railway or Render.

One Coolify instance (on a $6–10/month VPS) can host Paperclip plus other services — your own apps, databases, monitoring tools — all managed from one dashboard.

Step 1: Set up a VPS for Coolify

Coolify needs its own server (or you can run Paperclip alongside other apps on the same Coolify server).

Minimum requirements for Coolify + Paperclip:

  • 2 vCPU / 4 GB RAM (Hetzner CX22 at €4.51/month is ideal)
  • Ubuntu 22.04

SSH into your server:

ssh root@YOUR_SERVER_IP

Step 2: Install Coolify

curl -fsSL https://cdn.coollabs.io/coolify/install.sh | bash

This installs Docker, Docker Compose, and the Coolify application. Takes about 2 minutes.

After installation, access Coolify at http://YOUR_SERVER_IP:8000.

Complete the Coolify admin setup (create your admin account, configure your server).

Step 3: Configure a custom domain for Coolify (optional)

For production, point a domain to Coolify:

  1. Add an A record: coolify.yourdomain.com → YOUR_SERVER_IP
  2. In Coolify settings, set your domain
  3. Coolify handles its own SSL certificate via Let's Encrypt

Step 4: Create a Paperclip application in Coolify

  1. In the Coolify dashboard, click New Application
  2. Choose Docker Compose as the source type
  3. Create a new Docker Compose configuration

Step 5: Write the Docker Compose config

In Coolify's Docker Compose editor:

services:
  paperclip:
    image: node:20-alpine
    restart: unless-stopped
    command: sh -c "npm install -g paperclipai && npx paperclipai server start --port 3100 --host 0.0.0.0"
    environment:
      - NODE_ENV=production
      - PAPERCLIP_DATA_DIR=/data
      - BETTER_AUTH_SECRET=${BETTER_AUTH_SECRET}
      - PAPERCLIP_LISTEN_PORT=3100
      - PAPERCLIP_LISTEN_HOST=0.0.0.0
      - PAPERCLIP_MIGRATION_AUTO_APPLY=true
      - PAPERCLIP_MIGRATION_PROMPT=never
    volumes:
      - paperclip_data:/data
    ports:
      - "3100"
    healthcheck:
      test: ["CMD", "wget", "-qO-", "http://localhost:3100/api/health"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 60s

volumes:
  paperclip_data:

Step 6: Set environment variables

In Coolify's app settings, add the environment variable:

BETTER_AUTH_SECRET=your_random_64_char_secret_here

Generate it: openssl rand -hex 32

Mark it as a secret so it's stored encrypted.

Step 7: Configure domain and SSL

  1. In your Paperclip app settings in Coolify, go to Domains
  2. Add paperclip.yourdomain.com
  3. Coolify provisions a Let's Encrypt certificate automatically

Add the DNS A record: paperclip.yourdomain.com → YOUR_SERVER_IP

Step 8: Deploy

Click Deploy in Coolify. It pulls the Docker image, runs the compose file, and connects the domain.

Watch the deploy logs in the Coolify UI.

Step 9: First-time setup

Once deployed, open https://paperclip.yourdomain.com. Complete the Paperclip admin setup wizard.

Auto-deploy from Git

Coolify supports auto-deploy from GitHub repos. To set this up:

  1. In your app settings, connect your GitHub repo
  2. Set the branch to watch (main)
  3. Coolify redeploys on every push

For a Paperclip Dockerfile-based deployment:

  1. Create a GitHub repo with your Dockerfile and docker-compose.yml
  2. Connect the repo to Coolify
  3. Pushes to main trigger automatic redeploys

Persistent volumes in Coolify

The paperclip_data volume in the Docker Compose config persists data across deployments. Coolify manages these as named Docker volumes on your server.

To back up:

# SSH into your server
docker run --rm \
  -v coolify_paperclip_data:/data \
  -v /opt/backups:/backup \
  alpine tar czf /backup/paperclip-backup-$(date +%Y%m%d).tar.gz /data

Managing multiple services with Coolify

One advantage of Coolify: you can run Paperclip alongside other services on the same server — a PostgreSQL database, Plausible Analytics, Ghost blog — all managed from one dashboard with shared SSL and routing.

This makes your server much more cost-efficient. A €10/month Hetzner server running Coolify can host 5–10 small services that would each cost $7–12/month on managed platforms.

Cost

  • Coolify itself: Free (open source)
  • VPS (Hetzner CX22): €4.51/month
  • Total: €4.51/month for Paperclip + all other Coolify services

Railway starts with $20 free credit if you prefer not to manage Coolify.

Ready to deploy?

Affiliate disclosure: this link may earn us a commission at no extra cost to you.

This is an independent guide. Paperclip Hosting is not affiliated with the official Paperclip project. Guide steps are based on real deployments and are subject to change as the software evolves.