JournivJourniv
Installation

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 journiv

Download files

Download the SQLite docker-compose file and environment template:

curl -o docker-compose.yml https://raw.githubusercontent.com/journiv/journiv-app/refs/heads/main/docker-compose.prod.sqlite.yml

and environment template:

curl -O https://raw.githubusercontent.com/journiv/journiv-app/refs/heads/main/env.template

Alternatively, download these files from your browser and move them to the directory you created.

Download the PostgreSQL docker-compose file

curl -o docker-compose.yml https://raw.githubusercontent.com/journiv/journiv-app/refs/heads/main/docker-compose.prod.postgres.yml

and environment template:

curl -O https://raw.githubusercontent.com/journiv/journiv-app/refs/heads/main/env.template

Alternatively, 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 .env

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=latest

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=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.

Start the container

Start Journiv:

docker compose up -d

Access 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:

VariableDescriptionExamples / Notes
SECRET_KEYA 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_NAMEYour server IP address or domain name192.168.1.1, journiv.example.com, localhost

Complete list of environment variables can be found in the Environment Variables section.

Updating Journiv

To update to the latest version:

# Pull latest images
docker compose pull

# Restart services
docker compose up -d

Important: 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.gz

PostgreSQL backup:

# Backup PostgreSQL database
docker compose exec postgres pg_dump -U journiv journiv > backup.sql

Restore

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.sql

Environment Variables

Common environment variables for Docker Compose:

VariableDefaultDescription
SECRET_KEY-Required - Secret key for JWT token signing (minimum 32 characters)
DOMAIN_NAME-Required - Server IP address or domain name
DATABASE_URLsqlite:////data/journiv.dbDatabase connection string
APP_VERSIONlatestApplication version tag
DOMAIN_SCHEMEhttpDomain scheme (http, https)
MAX_FILE_SIZE_MB50Maximum file upload size in MB
IMPORT_EXPORT_MAX_FILE_SIZE_MB500Maximum import/export file size in MB
DISABLE_SIGNUPfalseDisable new user registration
MEDIA_ROOT/data/mediaDirectory for uploaded media files
EXPORT_DIR/data/exportsDirectory for exported data files

See Environment Variables for complete reference.

Troubleshooting

Container won't start

Check logs to identify the issue:

Docker Compose:

docker compose logs journiv

Docker Run:

docker logs journiv

Common issues:

  • Missing SECRET_KEY or DOMAIN_NAME environment variables
  • Port already in use (change host port with -p 8080:8000)
  • Permission issues with the /data volume

Port already in use

Change the host port in your configuration:

Docker Compose:

ports:
  - "8080:8000"  # Use port 8080 instead of 8000

Docker Run:

-p 8080:8000  # Use port 8080 instead of 8000

Permission issues

Ensure the data directory is writable:

For bind mounts:

chmod -R 755 /path/to/local/data

For named volumes: Docker handles permissions automatically. If issues persist, check volume access:

Docker Compose:

docker compose exec journiv ls -la /data

Docker Run:

docker exec journiv ls -la /data

Database connection errors

For PostgreSQL setups, verify the following:

Docker Compose:

  • PostgreSQL container is healthy: docker compose ps
  • DATABASE_URL is correct in your configuration
  • PostgreSQL credentials match between services

Docker Run:

  • Verify DATABASE_URL is correct
  • Ensure PostgreSQL is accessible from the container
  • Check PostgreSQL logs for connection issues

View logs

Docker Compose:

# All services
docker compose logs

# Specific service
docker compose logs journiv

# Follow logs in real-time
docker compose logs -f journiv

Docker Run:

# Follow logs in real-time
docker logs -f journiv

# View last 100 lines
docker logs --tail 100 journiv

Production Checklist

Before deploying to production:

Essentials:

  • Strong SECRET_KEY generated and stored securely
  • Strong POSTGRES_PASSWORD (if PostgreSQL is used)
  • Set DISABLE_SIGNUP to true to 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.