doc

Installation

Published: March 20, 2026Updated: March 22, 2026

Prerequisites (both scenarios)

  • Node.js 18+

  • pnpm (npm install -g pnpm)

  • PostgreSQL 14+

  • MinIO (or AWS S3 / Cloudflare R2)


Example 1 — Localhost (Development)

1. Clone & install dependencies

git clone https://github.com/your-org/postbase.com.git
cd postbase.com
pnpm install

2. Start PostgreSQL & MinIO

Using Docker Compose (easiest):

# PostgreSQL
docker run -d --name postbase-pg \
  -e POSTGRES_USER=postbase \
  -e POSTGRES_PASSWORD=postbase \
  -e POSTGRES_DB=postbase \
  -p 5432:5432 \
  postgres:16

# MinIO
docker run -d --name postbase-minio \
  -e MINIO_ROOT_USER=postbase \
  -e MINIO_ROOT_PASSWORD=postbase_secret \
  -p 9000:9000 -p 9001:9001 \
  minio/minio server /data --console-address ":9001"

3. Configure environment

Create apps/web/.env (already exists — verify or edit):

DATABASE_URL=postgresql://postbase:postbase@localhost:5432/postbase
AUTH_SECRET=supersecretchangeme
MINIO_ENDPOINT=http://localhost:9000
MINIO_ACCESS_KEY=postbase
MINIO_SECRET_KEY=postbase_secret

4. Run database migrations

cd apps/web
pnpm drizzle-kit push
cd ../..

5. Start the dev server

pnpm dev

Open http://localhost:3000.


Example 2 — VPS Server (Production)

Assumes you've SSH'd into a fresh Ubuntu/Debian VPS.

1. Install system dependencies

# Node.js 20
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs git

# pnpm
npm install -g pnpm

# PostgreSQL
sudo apt install -y postgresql postgresql-contrib

# Docker (for MinIO)
sudo apt install -y docker.io
sudo systemctl enable --now docker

2. Set up PostgreSQL

sudo -u postgres psql <<'SQL'
CREATE USER postbase WITH PASSWORD 'your_strong_password';
CREATE DATABASE postbase OWNER postbase;
SQL

3. Start MinIO

sudo docker run -d --name postbase-minio \
  --restart unless-stopped \
  -e MINIO_ROOT_USER=postbase \
  -e MINIO_ROOT_PASSWORD=your_strong_minio_secret \
  -p 9000:9000 \
  -v /data/minio:/data \
  minio/minio server /data

4. Clone & install

git clone https://github.com/your-org/postbase.com.git /opt/postbase
cd /opt/postbase
pnpm install

5. Configure environment

cat > /opt/postbase/apps/web/.env <<'EOF'
DATABASE_URL=postgresql://postbase:your_strong_password@localhost:5432/postbase
AUTH_SECRET=generate_a_64char_random_secret_here
NEXTAUTH_URL=https://yourdomain.com
POSTBASE_JWT_SECRET=another_64char_random_secret
MINIO_ENDPOINT=http://localhost:9000
MINIO_ACCESS_KEY=postbase
MINIO_SECRET_KEY=your_strong_minio_secret
EOF

Generate secrets:

node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"

6. Run migrations & build

cd /opt/postbase/apps/web
pnpm drizzle-kit push
cd /opt/postbase
pnpm build

7. Run with PM2

npm install -g pm2

pm2 start "pnpm start" --name postbase --cwd /opt/postbase/apps/web
pm2 save
pm2 startup   # follow printed command to enable on reboot

8. Reverse proxy with Nginx

sudo apt install -y nginx

sudo tee /etc/nginx/sites-available/postbase <<'EOF'
server {
    listen 80;
    server_name 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_cache_bypass $http_upgrade;
    }
}
EOF

sudo ln -s /etc/nginx/sites-available/postbase /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx

9. SSL with Certbot

sudo apt install -y certbot python3-certbot-nginx
sudo certbot --nginx -d yourdomain.com

App is now live at https://yourdomain.com.


Key env vars reference

VariableRequiredNotesDATABASE_URLYesPostgreSQL connection stringAUTH_SECRETYesNextAuth secret (random 32+ chars)NEXTAUTH_URLProd onlyFull public URL e.g. https://yourdomain.comPOSTBASE_JWT_SECRETOptionalPreferred JWT secret; falls back to AUTH_SECRETMINIO_ENDPOINTYesDefault http://localhost:9000MINIO_ACCESS_KEYYesDefault minioadminMINIO_SECRET_KEYYesDefault minioadmin