Nomploy Nomad Packs

← All packs

sftpgo v0.1.0

Files & sync

SFTPGo — a fully featured SFTP, FTP/S and WebDAV server with a web admin UI, per-user quotas and virtual folders, backed by many storage options. Deployed as a single host-networked Nomad service.

nomad-pack run sftpgo --registry nomploy
…or one line (add registry + run)
curl -fsSL https://packs.nomploy.com/install.sh | sh -s -- sftpgo

Needs nomad-pack on PATH. The script only adds the nomploy registry and runs this pack.

2 tasks http 8080sftp 2022 2 volumes image drakkan/sftpgo:latest tracks :latest image bumped today
Variables 10
values.hcl

Save as values.hcl, edit, then run:

nomad-pack run sftpgo -f values.hcl --registry nomploy
# The name of the Nomad job.
job_name = "sftpgo"

# The Nomad namespace to deploy into.
namespace = "default"

# The datacenters to deploy to.
datacenters = ["*"]

# The SFTPGo container image. Pin a tag in production.
image = "drakkan/sftpgo:latest"

# Host port for the SFTPGo web admin / client UI (HTTP).
port = 8080

# Host port for the SFTP service.
sftp_port = 2022

# Named volume mounted at /srv/sftpgo — persistent data and user home directories (data/<username>).
data_volume = "sftpgo_data"

# Named volume mounted at /var/lib/sftpgo — the SFTPGo config, SQLite database and host keys.
home_volume = "sftpgo_home"

# Placement constraints. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true".
constraints = []

# The task resources.
resources = {
    cpu    = 300
    memory = 256
  }
NameTypeDefaultDescription
job_name string
"sftpgo"
The name of the Nomad job.
namespace string
"default"
The Nomad namespace to deploy into.
datacenters list
["*"]
The datacenters to deploy to.
image string
"drakkan/sftpgo:latest"
The SFTPGo container image. Pin a tag in production.
port number
8080
Host port for the SFTPGo web admin / client UI (HTTP).
sftp_port number
2022
Host port for the SFTP service.
data_volume string
"sftpgo_data"
Named volume mounted at /srv/sftpgo — persistent data and user home directories (data/<username>).
home_volume string
"sftpgo_home"
Named volume mounted at /var/lib/sftpgo — the SFTPGo config, SQLite database and host keys.
constraints list
[]
Placement constraints. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true".
resources object
{
    cpu    = 300
    memory = 256
  }
The task resources.
Back up this pack

This pack stores data in 2 Docker named volumes: sftpgo_datasftpgo_home

restic

# Run on the node hosting this pack. Point restic at your repo first:
#   export RESTIC_REPOSITORY="s3:https://<account>.r2.cloudflarestorage.com/<bucket>"
#   export RESTIC_PASSWORD="<repo-password>"
#   export AWS_ACCESS_KEY_ID=<key>  AWS_SECRET_ACCESS_KEY=<secret>
restic backup \
  /var/lib/docker/volumes/sftpgo_data/_data \
  /var/lib/docker/volumes/sftpgo_home/_data

rclone (sync to S3/R2)

rclone sync /var/lib/docker/volumes/sftpgo_data/_data backup:<bucket>/sftpgo_data
rclone sync /var/lib/docker/volumes/sftpgo_home/_data backup:<bucket>/sftpgo_home

Paths assume the default Docker volume location (/var/lib/docker/volumes). Restore by stopping the job, restoring files into the same volume, and re-running the pack.

Readme

sftpgo

SFTPGo — a fully featured, self-hosted SFTP, FTP/S and WebDAV server with a web admin UI. Manage users and folders, set per-user quotas and bandwidth limits, use virtual/shared folders, and back accounts with local disk or object storage. Great for giving people or apps a secure file drop without exposing system accounts.

Single host-networked Nomad service exposing HTTP (admin/client UI) and SFTP, with persistent data and config volumes.

Deploy

nomad-pack registry add nomploy https://github.com/Nomploy/nomad-packs
nomad-pack run sftpgo --registry=nomploy

Configure

Variable Default Description
port 8080 Web admin / client UI port (SFTPGO_HTTPD__BINDINGS__0__PORT).
sftp_port 2022 SFTP service port (SFTPGO_SFTPD__BINDINGS__0__PORT).
image drakkan/sftpgo:latest Container image. Pin a tag in production.
data_volume sftpgo_data /srv/sftpgo — persistent data and per-user home directories.
home_volume sftpgo_home /var/lib/sftpgo — config, SQLite database and SSH host keys.
resources { cpu = 300, memory = 256 } Task resources.

First run: open http://<host>:8080/web/admin and create the admin account, then add users. A prestart init task chowns both volumes to uid 1000 (SFTPGo runs unprivileged). Point clients at the SFTP port (2022). Pin the job to the node holding the volumes with constraints.