Data directories
Nexus separates application code from persistent data. All data that must survive container rebuilds and updates lives outside the Docker container, on the host filesystem.
Directory layout
Section titled “Directory layout”/opt/nexus/ Application code and configuration├── .env Secrets and configuration (mode 600)├── Caddyfile Canonical Caddyfile (edit this, not /etc/caddy/Caddyfile)├── docker-compose.prod.yml Docker Compose configuration└── ... Application source files
/opt/nexus-data/ Persistent data (never touched by nexus-update)├── postgres/ PostgreSQL data volume└── uploads/ User-uploaded files ├── posts/ Images attached to posts ├── avatars/ User profile pictures ├── covers/ User profile cover images ├── logos/ Site logo, favicon, OG image ├── webp/ WebP-converted versions │ ├── posts/ │ ├── avatars/ │ ├── covers/ │ └── logos/ └── extensions/ └── <slug>/ Files for each installed extension
/opt/nexus-backups/ Backup archives (created by nexus-backup)├── db_TIMESTAMP.sql.gz└── uploads_TIMESTAMP.tar.gz/opt/nexus
Section titled “/opt/nexus”Application code, configuration, and management scripts. This directory is updated on every nexus-update run, except for files explicitly preserved:
| File | Preserved by nexus-update |
|---|---|
.env | ✓ Always preserved |
docker-compose.yml | ✓ Always preserved |
docker-compose.prod.yml | ✓ Always preserved |
Caddyfile | ✓ Always preserved |
| Everything else | ✗ Overwritten |
/opt/nexus/.env
Section titled “/opt/nexus/.env”Contains all secrets generated at install time. Mode 600 — readable only by root. Fields:
| Variable | Purpose |
|---|---|
PHX_HOST | The forum’s domain name |
SECRET_KEY_BASE | Phoenix session encryption key |
JWT_SECRET | JWT token signing secret |
SESSION_SIGNING_SALT | Session cookie signing salt |
DB_PASSWORD | PostgreSQL password |
Back this file up and store it securely. Loss of SECRET_KEY_BASE or JWT_SECRET invalidates all active sessions.
/opt/nexus-data
Section titled “/opt/nexus-data”Persistent data that survives container rebuilds and nexus-update. The Docker Compose file bind-mounts this directory into the container:
postgres/→ PostgreSQL stores its data files here. The database container reads and writes this directory directly.uploads/→ User-uploaded files. Mounted into the application container at/app/uploads.
This directory is never modified by nexus-update. It is your source of truth for all user-generated content.
/opt/nexus-backups
Section titled “/opt/nexus-backups”Created by nexus-backup. Contains database dumps and upload archives. Not created until the first backup is run. See Backups for details.
Disk space
Section titled “Disk space”The two directories that grow over time are:
/opt/nexus-data/postgres/— grows with forum activity (posts, users, indexes)/opt/nexus-data/uploads/— grows with user uploads
Monitor available disk space with:
df -h /opt/nexus-datadu -sh /opt/nexus-data/uploads /opt/nexus-data/postgresThe upload directory stores both original files and WebP-converted versions, so each uploaded image occupies roughly double the space of the original.