Special Offers: Up to 75% OFF on Hostinger & High-RAM Contabo Cloud VPS available this month.Compare Plans

How to Self-Host AFFiNE on Ubuntu Cloud VPS with Docker: Complete Notion Alternative

Marcus Vance
Marcus VanceFull-Stack Cloud Engineer
November 28, 2026
•
20 min read
•
4.9 / 5.0
Transparency Notice: This article contains affiliate links to hosting providers like Hostinger and Contabo. If you purchase through our links, we may earn a commission at zero extra cost to you. We only recommend products we personally benchmark and test. Read full disclosure.
How to Self-Host AFFiNE on Ubuntu Cloud VPS with Docker: Complete Notion Alternative

Hostinger vs. Contabo: Full Specifications Breakdown

Data verified from our lab benchmarks • Updated for 2026

Feature / Metric
HostingerEditor's Choice UI
ContaboMax RAM Value
Starting Price$2.99 / month (Web) | $4.99 / mo (VPS)$5.50 / month (Cloud VPS S)
vCPU Cores1 to 8 vCPU (Dedicated resources)4 to 12 vCPU (High Core Count)
RAM Memory4 GB to 32 GB6 GB to 64 GB (Gigantic RAM)
Storage Technology50 GB – 400 GB NVMe SSD50 GB NVMe or 300 GB SSD
Traffic / Bandwidth4 TB to 32 TB32 TB Outgoing + Unlimited In
Control Panel & UIhPanel (Ultra Modern & Easy)cPanel, Plesk, Webmin, or CLI
Customer Support24/7 Live Chat & AI Support (Multi-lingual)Email Ticket Support (German Business Hours)
Best ForBloggers, WordPress Sites & Devs wanting easy UIHeavy Database, Docker, Game Servers & SysAdmins
Money-Back Guarantee30-Day Money-Back Guarantee14-Day EU Statutory Cancellation
Official LinksVisit HostingerVisit Contabo
Quick Answer & Key Takeaways
Updated November 28, 2026 • Lab Score 4.9/5.0

Regain complete privacy and data sovereignty over your documents and whiteboards. Learn how to install self-hosted AFFiNE workspace with Docker and Caddy reverse proxy.

  • Bridges the gap between structured Notion-like documents and Miro-style infinite canvas whiteboards
  • True local-first architecture: edits are stored on-device and synced securely without corporate telemetry
  • Zero recurring per-user SaaS license fees ($10-$20/user/mo saved compared to Notion Team)

The Fragility of Proprietary Cloud Workspaces

Modern product teams, independent creators, and knowledge workers rely heavily on productivity suites like Notion, Miro, and Confluence. We entrust them with our intellectual property, project roadmaps, research notes, and personal journals. However, storing proprietary documentation on closed, US-hosted SaaS platforms presents significant operational vulnerabilities:

  • Privacy & Telemetry: Enterprise AI features on commercial workspaces frequently scrape document contents to train underlying LLMs unless expensive enterprise opt-outs are negotiated.
  • Vendor Lock-in: Exporting complex hierarchical workspaces with nested databases from proprietary clouds frequently produces corrupted files and broken links.
  • Skyrocketing Per-Seat Fees: Notion charges $10 to $18 per user per month. A small team of 10 people quickly spends upwards of $1,800 to $2,160 annually simply to write text documents.

AFFiNE is the revolutionary open-source, local-first alternative. Built from the ground up to respect data sovereignty, AFFiNE unifies document writing, spatial mind-mapping, and structured relational tables into a single interface. With a single click, any document transforms from a standard Markdown text page into an infinite whiteboard canvas.

By self-hosting AFFiNE on a reliable Contabo Cloud VPS ($4.95/mo for 8GB RAM) or Hostinger KVM VPS ($6.99/mo), you gain total control over your knowledge headquarters with zero recurring user licensing costs.

AFFiNE utilizes PostgreSQL for transactional data persistence and Redis for real-time multiplayer cursor synchronization:

Workspace Size Active Collaborators Recommended Server RAM Allocation
Solo Professional 1 User Hostinger KVM 1 / Contabo Cloud 1 4 GB - 8 GB RAM
Small Team 2 - 15 Users Contabo Cloud VPS 1 ($4.95/mo) 8 GB RAM (Ideal)
Agency / Enterprise 20+ Users Contabo Cloud VPS 2 ($8.95/mo) 16 GB RAM

Step 1: Initial Server Preparation & Docker Engine

Connect to your VPS via SSH as root and update the package repositories:

ssh root@YOUR_SERVER_IP
apt update && apt upgrade -y
apt install -y curl git ufw fail2ban jq
curl -fsSL https://get.docker.com | sh
systemctl enable --now docker

Configure the UFW firewall to secure host ports:

ufw default deny incoming
ufw default allow outgoing
ufw allow 22/tcp
ufw allow 80/tcp
ufw allow 443/tcp
ufw --force enable

Step 2: Domain DNS Pointing

Navigate to your domain DNS registrar (or Cloudflare) and create an A record pointing your chosen workspace subdomain to your server's public IP address:

  • Host / Name: workspace (for workspace.yourdomain.com)
  • Target / Value: YOUR_SERVER_PUBLIC_IP
  • TTL: 3600 (or Auto)

Step 3: Creating the AFFiNE Container Architecture

Create a dedicated directory to store the configuration and persistent database volumes:

mkdir -p /opt/affine
cd /opt/affine

Generate a secure random password for your PostgreSQL database:

openssl rand -hex 16

Create the docker-compose.yml file:

cat << 'EOF' > /opt/affine/docker-compose.yml
services:
  affine:
    image: ghcr.io/toeverything/affine-graphql:stable
    container_name: affine_server
    restart: unless-stopped
    ports:
      - "127.0.0.1:3010:3010"
    environment:
      - NODE_ENV=production
      - AFFINE_ENV=production
      - DATABASE_URL=postgres://affine:YOUR_SECURE_PASSWORD@postgres:5432/affine
      - REDIS_SERVER_HOST=redis
      - REDIS_SERVER_PORT=6379
      - AFFINE_SERVER_HOST=workspace.yourdomain.com
      - AFFINE_SERVER_PORT=3010
      - AFFINE_SERVER_HTTPS=true
    depends_on:
      - postgres
      - redis
    volumes:
      - /opt/affine/storage:/root/.affine/storage
      - /opt/affine/config:/root/.affine/config

  postgres:
    image: postgres:16-alpine
    container_name: affine_postgres
    restart: unless-stopped
    environment:
      - POSTGRES_USER=affine
      - POSTGRES_PASSWORD=YOUR_SECURE_PASSWORD
      - POSTGRES_DB=affine
    volumes:
      - /opt/affine/pgdata:/var/lib/postgresql/data

  redis:
    image: redis:7-alpine
    container_name: affine_redis
    restart: unless-stopped
    volumes:
      - /opt/affine/redisdata:/data
EOF

Replace YOUR_SECURE_PASSWORD with your generated token, and set AFFINE_SERVER_HOST to your exact domain name.

Step 4: Launching the Stack & Automated SSL with Caddy

Start the container fleet in detached mode:

docker compose up -d

Install Caddy to handle automatic Let's Encrypt SSL issuance and HTTP/2 reverse proxying:

apt install -y caddy
cat << 'EOF' > /etc/caddy/Caddyfile
workspace.yourdomain.com {
    encode gzip zstd
    reverse_proxy 127.0.0.1:3010
}
EOF
systemctl restart caddy

Step 5: First-Time Onboarding & Admin Account

Open your browser and navigate to https://workspace.yourdomain.com.

  1. Click Sign in / Register.
  2. The very first account registered on the instance is automatically designated as the system administrator.
  3. Once inside, create your first workspace. You can immediately create notes, Kanban task boards, and infinite canvas brainstorm layouts.

Step 6: Syncing with Desktop Clients (macOS, Windows, Linux)

One of AFFiNE's greatest strengths is its native desktop applications. You do not have to work exclusively in a browser tab:

  1. Download the official client from affine.pro/download.
  2. Launch the desktop app on your laptop.
  3. Click Settings > Cloud Sync > Add Self-Hosted Server.
  4. Input your instance URL: https://workspace.yourdomain.com and authenticate.

Now all your work is saved locally on your laptop SSD for lightning-fast offline editing, and automatically pushes encrypted diffs to your VPS whenever an internet connection is available.

Frequently Asked Questions (FAQ)

Can I import existing documents from Notion?

Yes. In Notion, navigate to Settings > Export all workspace content as Markdown & CSV. Inside AFFiNE, click Settings > Import and select your Notion zip archive. Your pages and hierarchy will be reconstructed automatically.

How can I automate database backups?

Create a simple daily cron job running docker exec affine_postgres pg_dump -U affine affine > /opt/affine/backups/affine_$(date +%F).sql to safeguard all your team documents.

Final Verdict

Self-hosting AFFiNE on a budget cloud VPS like Contabo or Hostinger gives your team a private, distraction-free creative operating system matching Notion's polish while preserving complete data ownership.

Video Walkthrough & Official References

How to Use Docker Compose to Manage Containers on Linux VPS • syncbricks

Watch on YouTube

Editorial Verdict: Pros & Cons

What We Love (Pros)

  • Bridges the gap between structured Notion-like documents and Miro-style infinite canvas whiteboards
  • True local-first architecture: edits are stored on-device and synced securely without corporate telemetry
  • Zero recurring per-user SaaS license fees ($10-$20/user/mo saved compared to Notion Team)
  • Native cross-platform synchronization with desktop apps for macOS, Windows, Linux, and mobile browsers

Drawbacks (Cons)

  • Requires a server with at least 4 GB RAM for smooth multi-user WebSocket document collaboration
Marcus Vance

Written by Marcus Vance

Full-Stack Cloud Engineer

Alex and the ServerCraft engineering lab run routine benchmarks on over 25 web hosting providers, maintaining strict objectivity and reproducibility.

Recommended Next Reads