Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Setup

Vykar includes a dedicated backup server for secure, policy-enforced remote backups. TLS is handled by a reverse proxy (nginx, caddy, and similar tools).

Why a dedicated REST server instead of plain S3

Dumb storage backends (S3, WebDAV, SFTP) work well for basic backups, but they cannot enforce policy or do server-side work. vykar-server adds capabilities that object storage alone cannot provide.

CapabilityS3 / dumb storagevykar-server
Append-only modeNot enforceable; a compromised client with S3 credentials can delete anythingRejects delete and pack overwrite operations
Server-side compactionClient must download and re-upload all live blobsServer repacks locally on disk from a compact plan
Quota enforcementRequires external bucket policy/IAM setupBuilt-in byte quota checks on writes
Backup freshness monitoringRequires external polling and parsingTracks last_backup_at on manifest writes
Lock auto-expiryAdvisory locks can remain after crashesTTL-based lock cleanup in the server
Upload integrityRelies on S3 Content-MD5Uses existing BLAKE2b checksum
Structural health checksClient has to fetch data to verify structureServer validates repository shape directly

All data remains client-side encrypted. The server never has the encryption key and cannot read backup contents.

Install

Download a binary for your platform from the releases page.

Server configuration

All settings are passed as CLI flags. The authentication token is read from the VYKAR_TOKEN environment variable (kept out of process arguments to avoid exposure in ps output).

CLI flags

FlagDefaultDescription
-l, --listenlocalhost:8585Address to listen on
-d, --data-dir/var/lib/vykarRoot directory for the repository
--append-onlyfalseReject DELETE and overwrite operations on pack files
--log-formatprettyLog output format: json or pretty
--quota0Storage quota (500M, 10G, plain bytes). 0 = unlimited
--lock-ttl-seconds3600Auto-expire locks after this many seconds
--network-threads4Async threads for handling network connections
--io-threads6Threads for blocking disk I/O (reads, writes, hashing)

Environment variables

VariableRequiredDescription
VYKAR_TOKENYesShared bearer token for authentication

Start the server

export VYKAR_TOKEN="some-secret-token"
vykar-server --data-dir /var/lib/vykar

Run as a systemd service

Create an environment file at /etc/vykar/vykar-server.env with restricted permissions:

sudo mkdir -p /etc/vykar
echo 'VYKAR_TOKEN=some-secret-token' | sudo tee /etc/vykar/vykar-server.env
sudo chmod 600 /etc/vykar/vykar-server.env
sudo chown vykar:vykar /etc/vykar/vykar-server.env

Create /etc/systemd/system/vykar-server.service:

[Unit]
Description=Vykar backup REST server
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User=vykar
Group=vykar
EnvironmentFile=/etc/vykar/vykar-server.env
ExecStart=/usr/local/bin/vykar-server --data-dir /var/lib/vykar
Restart=on-failure
RestartSec=2
NoNewPrivileges=true
PrivateTmp=true
ProtectSystem=full
ProtectHome=true
ReadWritePaths=/var/lib/vykar

[Install]
WantedBy=multi-user.target

Then reload and enable:

sudo systemctl daemon-reload
sudo systemctl enable --now vykar-server.service
sudo systemctl status vykar-server.service

Reverse proxy

vykar-server listens on HTTP and expects a reverse proxy to handle TLS. Pack uploads can be up to 512 MiB, so the proxy must allow large request bodies.

Nginx

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

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

    client_max_body_size    600m;              # vykar-server allows up to 512 MiB
    proxy_request_buffering off;               # stream uploads directly to backend

    location / {
        proxy_pass http://127.0.0.1:8585;
    }
}

Caddy

backup.example.com {
    request_body {
        max_size 600MB
    }
    reverse_proxy 127.0.0.1:8585
}

Client configuration (REST backend)

repositories:
  - label: "server"
    url: "https://backup.example.com"
    access_token: "some-secret-token"

encryption:
  mode: "auto"

sources:
  - "/home/user/documents"

All standard commands (init, backup, list, info, restore, delete, prune, check, compact) work over REST without CLI workflow changes.

Health check

# No auth required
curl http://localhost:8585/health

Returns {"status": "ok", "version": "..."}. No authentication required.