Skip to content

Deployment

Suryaprakash edited this page Jul 27, 2026 · 1 revision

Deployment

Production deployment guide for Nexora.


Docker Compose (Recommended)

services:
  nexora:
    image: ghcr.io/suryaprakash251201/nexora:latest
    container_name: nexora
    ports:
      - "80:80"
    volumes:
      - ./data:/app/data
    environment:
      - NEXORA_DATA_DIR=/app/data
      - NEXORA_DATABASE_PATH=/app/data/nexora.db
      - NEXORA_LISTEN_ADDR=:8080
      - NEXORA_LOG_LEVEL=info
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "wget", "-q", "-O", "-", "http://localhost:8080/healthz"]
      interval: 30s
      timeout: 10s
      retries: 3
docker compose up -d

Environment Variables

Variable Default Description
NEXORA_LISTEN_ADDR :8080 HTTP listen
NEXORA_DATA_DIR ./data Data dir
NEXORA_DATABASE_PATH $DATA_DIR/nexora.db SQLite path
NEXORA_DATABASE_URL PostgreSQL DSN
NEXORA_SESSION_SECRET auto 32-byte hex
NEXORA_THUMBNAIL_CACHE_DIR $DATA_DIR/cache/thumbnails Thumbnails
NEXORA_LOG_LEVEL info debug/info/warn/error
NEXORA_SECURE_COOKIES false Require HTTPS
NEXORA_CORS_ORIGINS Comma-separated

Database

SQLite (Default)

Zero-config. Backup:

sqlite3 /app/data/nexora.db ".backup /backup/nexora-$(date +%F).db"

PostgreSQL (Production)

environment:
  - NEXORA_DATABASE_URL=postgres://user:pass@db:5432/nexora?sslmode=require

nginx Reverse Proxy

server {
    listen 443 ssl http2;
    server_name files.example.com;

    ssl_certificate /etc/letsencrypt/live/files.example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/files.example.com/privkey.pem;

    client_max_body_size 10G;
    client_body_timeout 300s;

    location / {
        proxy_pass http://localhost:8080;
        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_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_read_timeout 86400;
    }

    location /assets/ {
        alias /app/web/assets/;
        expires 1y;
        add_header Cache-Control "public, immutable";
    }
}

Kubernetes

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nexora
spec:
  replicas: 2
  selector:
    matchLabels:
      app: nexora
  template:
    spec:
      containers:
      - name: nexora
        image: ghcr.io/suryaprakash251201/nexora:latest
        ports:
        - containerPort: 8080
        env:
        - name: NEXORA_DATA_DIR
          value: "/data"
        - name: NEXORA_LISTEN_ADDR
          value: ":8080"
        volumeMounts:
        - name: data
          mountPath: /data
        livenessProbe:
          httpGet:
            path: /healthz
            port: 8080
        readinessProbe:
          httpGet:
            path: /readyz
            port: 8080
---
apiVersion: v1
kind: Service
metadata:
  name: nexora
spec:
  selector:
    app: nexora
  ports:
  - port: 8080
    targetPort: 8080

Systemd (Bare Metal)

[Unit]
Description=Nexora File Workspace
After=network.target

[Service]
Type=simple
User=nexora
WorkingDirectory=/opt/nexora
ExecStart=/opt/nexora/nexora
Restart=always
Environment=NEXORA_DATA_DIR=/var/lib/nexora
Environment=NEXORA_DATABASE_PATH=/var/lib/nexora/nexora.db
Environment=NEXORA_LISTEN_ADDR=:8080
LimitNOFILE=65536

[Install]
WantedBy=multi-user.target

Backup Strategy

#!/bin/bash
BACKUP_DIR="/backup/nexora"
DATE=$(date +%F)

mkdir -p "$BACKUP_DIR"
sqlite3 /var/lib/nexora/nexora.db ".backup $BACKUP_DIR/nexora-$DATE.db"
tar -czf "$BACKUP_DIR/config-$DATE.tar.gz" /etc/nexora/

# Prune older than 30 days
find "$BACKUP_DIR" -name "nexora-*.db" -mtime +30 -delete

Troubleshooting

Issue Fix
502 Bad Gateway Backend not ready, check logs
CSRF mismatch Proxy stripping cookies
WebSocket 400 Missing Upgrade/Connection headers
Upload >1MB fails Set client_max_body_size in nginx
Search empty Run nexora search reindex

Related Pages

Clone this wiki locally