Docker Installation
Install Journiv using Docker Compose for production-ready deployments with optional PostgreSQL.
Docker Compose is recommended for production deployments. It provides easy configuration management, allows you to run multiple services together, and simplifies updates and maintenance.
Installation
Create a directory
Create a directory for your Journiv installation:
mkdir journiv
cd journivDownload files
Download the PostgreSQL docker-compose file
curl -o docker-compose.yml https://raw.githubusercontent.com/journiv/journiv-app/refs/tags/latest/docker-compose.ymland environment template:
curl -O https://raw.githubusercontent.com/journiv/journiv-app/refs/tags/latest/env.templateAlternatively, download these files from your browser and move them to the directory you created.
Download the SQLite docker-compose file and environment template:
curl -o docker-compose.yml https://raw.githubusercontent.com/journiv/journiv-app/refs/tags/latest/docker-compose.sqlite.ymland environment template:
curl -O https://raw.githubusercontent.com/journiv/journiv-app/refs/tags/latest/env.templateAlternatively, download these files from your browser and move them to the directory you created.
Generate a secure SECRET_KEY
Before configuring your environment, generate a strong secret key:
# Using OpenSSL (recommended)
openssl rand -base64 32
# Or using Python
python -c "import secrets; print(secrets.token_urlsafe(32))"Important: Use a different SECRET_KEY for each instance. Never share your secret key or commit it to version control.
Configure environment
Rename the template file to .env:
mv env.template .envEdit the .env file with your settings, using the SECRET_KEY you generated:
SECRET_KEY=your-generated-secret-key-here
DOMAIN_NAME=192.168.1.1
APP_VERSION=latest
DB_DRIVER=postgres
# Preferred: POSTGRES_PASSWORD
POSTGRES_PASSWORD=your-secure-password
# OR: DATABASE_URL with a PostgreSQL URL (postgresql:// or postgres://)
DATABASE_URL=postgresql://user:password@host:5432/dbname
# Do not specify both POSTGRES_PASSWORD and DATABASE_URL. They are mutually exclusive.Choose a strong password for POSTGRES_PASSWORD.
Edit the .env file with your settings, using the SECRET_KEY you generated:
SECRET_KEY=your-generated-secret-key-here
DOMAIN_NAME=192.168.1.1
APP_VERSION=latestStart the container
Start Journiv:
docker compose up -dAccess the application
Visit http://192.168.1.1:8000 (or your configured domain) to access Journiv.
Required Environment Variables
Two environment variables are required for Journiv to run:
| Variable | Description | Examples / Notes |
|---|---|---|
SECRET_KEY | A strong secret key for JWT token signing (minimum 32 characters) | Generate with: openssl rand -base64 32 or python -c "import secrets; print(secrets.token_urlsafe(32))" |
DOMAIN_NAME | Your server IP address or domain name | 192.168.1.1, journiv.example.com, localhost |
Complete list of environment variables can be found in the Environment Variables section.
Configuration Details
Volume Mounts
The container uses /data as the data directory. Mount this to persist data:
# In docker-compose.yml
services:
journiv:
volumes:
- app_data:/data # Named volume (recommended)
# OR
- /path/to/local/data:/data # Bind mountData stored in /data:
- Database file (
journiv.dbfor SQLite) - Media files (
media/) - Logs (
logs/) - Exports (
exports/) - Imports (
imports/)
Port Configuration
Change the host port if 8000 is already in use:
# In docker-compose.yml
services:
journiv:
ports:
- "8080:8000" # Use port 8080 on host, 8000 in containerAccess Journiv at http://192.168.1.1:8080 instead.
Updating Journiv
To update to the latest version:
# Pull latest images
docker compose pull
# Restart services
docker compose up -dImportant: Always backup your data before updating. Database migrations run automatically on startup.
Backup and Restore
Backup
Full backup (database + media):
# Create backup archive
docker compose exec journiv tar czf /data/backup-$(date +%Y%m%d).tar.gz /data
# Copy backup to host
docker compose cp journiv:/data/backup-YYYYMMDD.tar.gz ./backup.tar.gzPostgreSQL backup:
# Backup PostgreSQL database
docker compose exec postgres pg_dump -U journiv journiv > backup.sqlRestore
From archive:
# Copy archive to container
docker compose cp ./backup.tar.gz journiv:/data/backup.tar.gz
# Extract archive
docker compose exec journiv tar xzf /data/backup.tar.gz -C /PostgreSQL restore:
# Restore PostgreSQL database
docker compose exec -T postgres psql -U journiv journiv < backup.sqlEnvironment Variables
Common environment variables for Docker Compose:
| Variable | Default | Description |
|---|---|---|
SECRET_KEY | - | Required - Secret key for JWT token signing (minimum 32 characters) |
DOMAIN_NAME | - | Required - Server IP address or domain name |
DATABASE_URL | sqlite:////data/journiv.db | Database connection string |
APP_VERSION | latest | Application version tag |
DOMAIN_SCHEME | http | Domain scheme (http, https) |
MAX_FILE_SIZE_MB | 50 | Maximum file upload size in MB |
IMPORT_EXPORT_MAX_FILE_SIZE_MB | 500 | Maximum import/export file size in MB |
DISABLE_SIGNUP | false | Disable new user registration |
MEDIA_ROOT | /data/media | Directory for uploaded media files |
EXPORT_DIR | /data/exports | Directory for exported data files |
See Environment Variables for complete reference.
Troubleshooting
Container won't start
Check logs to identify the issue:
docker compose logs journivCommon issues:
- Missing
SECRET_KEYorDOMAIN_NAMEenvironment variables - Port already in use (change host port with
-p 8080:8000) - Permission issues with the
/datavolume - "Invalid Host Header": Ensure
DOMAIN_NAMEorCORS_ORIGINSincludes the hostname you are using to access the app.
Port already in use
Change the host port in your docker-compose.yml file:
ports:
- "8080:8000" # Use port 8080 instead of 8000Permission issues
Ensure the data directory is writable:
For bind mounts:
chmod -R 755 /path/to/local/dataFor named volumes: Docker handles permissions automatically. If issues persist, check volume access:
docker compose exec journiv ls -la /dataDatabase connection errors
For PostgreSQL setups, verify the following:
- PostgreSQL container is healthy:
docker compose ps DATABASE_URLis correct in your configuration- PostgreSQL credentials match between services
View logs
# All services
docker compose logs
# Specific service
docker compose logs journiv
# Follow logs in real-time
docker compose logs -f journivProduction Checklist
Before deploying to production:
Essentials:
- Strong
SECRET_KEYgenerated and stored securely - Strong
POSTGRES_PASSWORD(if PostgreSQL is used) - Set
DISABLE_SIGNUPtotrueto prevent new user registration - HTTPS configured with reverse proxy
Nice to have:
- Monitoring and alerting set up
- Resource limits configured
- Regular backups plan in place
- Firewall rules configured
- Log rotation configured
- Keep Journiv updated to the latest version
See Configuration for detailed production setup.