This guide provides instructions for installing CUPCAKE without Docker on lower power systems. The native installation is designed for systems with limited resources where Docker overhead might be problematic.
- OS: Ubuntu 20.04+ or Debian 11+
- RAM: 2GB (minimum), 4GB recommended
- Storage: 5GB free space (minimum), 10GB recommended
- CPU: 1 core (minimum), 2+ cores recommended
- Ubuntu 20.04 LTS, 22.04 LTS, 24.04 LTS
- Debian 11 (Bullseye), 12 (Bookworm)
The native installation consists of the following components:
- PostgreSQL 14: Database server
- Redis: Cache and message broker
- Nginx: Web server and reverse proxy
- Gunicorn: WSGI server for Django application
- systemd: Service management
- Background Worker: General task processing
- Document Export Worker: Protocol document generation
- Data Import Worker: Bulk data import processing
- OCR Worker: Optical Character Recognition (optional)
- Transcription Worker: Audio transcription with Whisper (optional)
/opt/cupcake/
├── app/ # Django application
├── venv/ # Python virtual environment
├── media/ # User uploaded files
└── static/ # Static web assets
/var/log/cupcake/ # Application logs
-
Download and run the installation script:
wget https://raw.githubusercontent.com/noatgnu/cupcake/main/install_cupcake_native.sh chmod +x install_cupcake_native.sh ./install_cupcake_native.sh
-
Follow the interactive prompts to configure:
- Hostname (e.g., localhost or your domain)
- Web server port (default: 8080)
- Database credentials
- Optional features (OCR, Whisper, Workers)
- Admin user credentials
-
Access your installation:
- Web Interface:
http://your-hostname:port - Admin Interface:
http://your-hostname:port/admin
- Web Interface:
If you prefer to install manually or need to customize the installation:
# Update package lists
sudo apt update
# Install core packages
sudo apt install -y \
python3 python3-pip python3-venv python3-dev \
postgresql postgresql-contrib postgresql-client \
redis-server nginx git curl wget \
build-essential pkg-config libpq-dev \
libssl-dev libffi-dev libjpeg-dev libpng-dev \
ffmpeg supervisor openssl bc
# Install Node.js for frontend building
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs
# Optional: Install OCR packages
sudo apt install -y tesseract-ocr tesseract-ocr-eng# Start PostgreSQL
sudo systemctl start postgresql
sudo systemctl enable postgresql
# Create database and user
sudo -u postgres psql << EOF
CREATE USER cupcake_user WITH PASSWORD 'your_password';
CREATE DATABASE cupcake_db OWNER cupcake_user;
GRANT ALL PRIVILEGES ON DATABASE cupcake_db TO cupcake_user;
ALTER USER cupcake_user CREATEDB;
EOF# Configure Redis with password
sudo sed -i 's/^# requirepass foobared/requirepass redis/' /etc/redis/redis.conf
sudo systemctl start redis-server
sudo systemctl enable redis-server# Create system user
sudo useradd --system --shell /bin/bash --home-dir /opt/cupcake --create-home cupcake
# Create directories
sudo mkdir -p /opt/cupcake/{app,venv,media,static} /var/log/cupcake
sudo chown -R cupcake:cupcake /opt/cupcake
sudo chown -R cupcake:www-data /var/log/cupcake
# Clone and install application
sudo -u cupcake git clone https://github.com/noatgnu/cupcake.git /opt/cupcake/app
sudo -u cupcake python3 -m venv /opt/cupcake/venv
sudo -u cupcake /opt/cupcake/venv/bin/pip install -r /opt/cupcake/app/requirements.txt
sudo -u cupcake /opt/cupcake/venv/bin/pip install gunicorn# Build Angular frontend
git clone https://github.com/noatgnu/cupcake-ng.git /tmp/cupcake-ng
cd /tmp/cupcake-ng
# Update environment configuration
sed -i 's;https://cupcake.proteo.info;http://localhost:8080;g' src/environments/environment.ts
# Build and install
npm install
npm run build
sudo cp -r dist/browser/* /opt/cupcake/static/
sudo chown -R cupcake:www-data /opt/cupcake/staticCreate /opt/cupcake/app/local_settings.py:
DEBUG = False
ALLOWED_HOSTS = ['localhost', '127.0.0.1', 'your-hostname']
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'cupcake_db',
'USER': 'cupcake_user',
'PASSWORD': 'your_password',
'HOST': 'localhost',
'PORT': '5432',
}
}
CACHES = {
'default': {
'BACKEND': 'django_redis.cache.RedisCache',
'LOCATION': 'redis://127.0.0.1:6379/1',
'OPTIONS': {
'CLIENT_CLASS': 'django_redis.client.DefaultClient',
'CONNECTION_POOL_KWARGS': {'password': 'redis'}
}
}
}
SECRET_KEY = 'your-secret-key'
STATIC_ROOT = '/opt/cupcake/static'
MEDIA_ROOT = '/opt/cupcake/media'
# Feature flags
USE_COTURN = False
USE_WHISPER = True # Set to False if not needed
USE_OCR = True # Set to False if not needed
USE_LLM = FalseCreate systemd service files for automatic startup and management. See the installation script for complete service definitions.
cd /opt/cupcake/app
sudo -u cupcake /opt/cupcake/venv/bin/python manage.py migrate
sudo -u cupcake /opt/cupcake/venv/bin/python manage.py collectstatic --noinput
sudo -u cupcake /opt/cupcake/venv/bin/python manage.py createsuperuserAfter installation, use the cupcake command for management:
cupcake start # Start all services
cupcake stop # Stop all services
cupcake restart # Restart all services
cupcake status # Show service status
cupcake logs # View live logscupcake django createsuperuser # Create admin user
cupcake django shell # Django shell
cupcake django migrate # Run migrations
cupcake django collectstatic # Collect static filescupcake backup # Create database backup
cupcake update # Update from git repository# Start/stop individual services
sudo systemctl start cupcake-web.service
sudo systemctl start cupcake-worker.service
sudo systemctl start cupcake-docx-worker.service
sudo systemctl start cupcake-import-worker.service
sudo systemctl start cupcake-ocr-worker.service
sudo systemctl start cupcake-transcribe-worker.service
# Check service status
sudo systemctl status cupcake-web.service
# View service logs
sudo journalctl -u cupcake-web.service -fConfiguration is primarily handled through Django settings. Key settings in local_settings.py:
DEBUG: Set toFalsefor productionALLOWED_HOSTS: List of allowed hostnamesDATABASES: PostgreSQL connection settingsSECRET_KEY: Django secret key (generate withopenssl rand -base64 32)- Feature flags:
USE_WHISPER,USE_OCR,USE_LLM,USE_COTURN
The Nginx configuration is located at /etc/nginx/sites-available/cupcake. Key settings:
listen: Web server portserver_name: Hostnameclient_max_body_size: Maximum upload size- Proxy settings for API endpoints
For lower power systems, you can adjust:
- Gunicorn workers: Reduce from 4 to 2 in the systemd service file
- Database connections: Set
CONN_MAX_AGEin Django settings - Cache timeout: Adjust Redis cache settings
- Worker concurrency: Limit concurrent background tasks
-
Services won't start
# Check service status sudo systemctl status cupcake-web.service # Check logs sudo journalctl -u cupcake-web.service -n 50
-
Database connection errors
# Test database connection sudo -u cupcake /opt/cupcake/venv/bin/python -c " import psycopg2 conn = psycopg2.connect( host='localhost', database='cupcake_db', user='cupcake_user', password='your_password' ) print('Database connection successful') "
-
Permission issues
# Fix file permissions sudo chown -R cupcake:cupcake /opt/cupcake sudo chown -R cupcake:www-data /var/log/cupcake sudo chmod -R 755 /opt/cupcake/media /opt/cupcake/static -
Frontend not loading
# Check Nginx configuration sudo nginx -t # Restart Nginx sudo systemctl restart nginx # Check if static files are properly collected sudo -u cupcake /opt/cupcake/venv/bin/python /opt/cupcake/app/manage.py collectstatic --noinput
For lower power systems:
-
Reduce worker processes: Edit
/etc/systemd/system/cupcake-web.serviceand change--workers 4to--workers 2 -
Optimize PostgreSQL: Edit
/etc/postgresql/*/main/postgresql.conf:shared_buffers = 128MB effective_cache_size = 512MB work_mem = 4MB maintenance_work_mem = 64MB -
Disable unnecessary workers:
sudo systemctl disable cupcake-ocr-worker.service sudo systemctl disable cupcake-transcribe-worker.service
- Django logs:
/var/log/cupcake/django.log - Gunicorn access logs:
/var/log/cupcake/access.log - Gunicorn error logs:
/var/log/cupcake/error.log - System logs:
sudo journalctl -u cupcake-web.service
-
Database security:
- Use strong passwords
- Limit PostgreSQL connections to localhost
- Regular backups
-
Web server security:
- Use HTTPS in production (configure SSL certificates)
- Set appropriate file permissions
- Regular system updates
-
Application security:
- Keep Django and dependencies updated
- Use strong SECRET_KEY
- Monitor logs for suspicious activity
# Create backup
sudo -u postgres pg_dump cupcake_db > backup_$(date +%Y%m%d_%H%M%S).sql
# Restore backup
sudo -u postgres psql cupcake_db < backup_file.sql# Backup media files
tar -czf media_backup_$(date +%Y%m%d_%H%M%S).tar.gz /opt/cupcake/media
# Backup configuration
tar -czf config_backup_$(date +%Y%m%d_%H%M%S).tar.gz /opt/cupcake/app/local_settings.py /etc/nginx/sites-available/cupcakeTo upgrade to a newer version:
# Automated upgrade
cupcake update
# Manual upgrade
cd /opt/cupcake/app
sudo -u cupcake git pull
sudo -u cupcake /opt/cupcake/venv/bin/pip install -r requirements.txt
sudo -u cupcake /opt/cupcake/venv/bin/python manage.py migrate
sudo -u cupcake /opt/cupcake/venv/bin/python manage.py collectstatic --noinput
cupcake restartTo completely remove CUPCAKE:
# Stop services
cupcake stop
# Disable services
sudo systemctl disable cupcake-web.service
sudo systemctl disable cupcake-worker.service
sudo systemctl disable cupcake-docx-worker.service
sudo systemctl disable cupcake-import-worker.service
sudo systemctl disable cupcake-ocr-worker.service
sudo systemctl disable cupcake-transcribe-worker.service
# Remove service files
sudo rm /etc/systemd/system/cupcake-*.service
sudo systemctl daemon-reload
# Remove application files
sudo rm -rf /opt/cupcake
sudo rm -rf /var/log/cupcake
# Remove Nginx configuration
sudo rm /etc/nginx/sites-available/cupcake
sudo rm /etc/nginx/sites-enabled/cupcake
sudo systemctl restart nginx
# Remove database (optional)
sudo -u postgres dropdb cupcake_db
sudo -u postgres dropuser cupcake_user
# Remove user
sudo userdel cupcake
# Remove management command
sudo rm /usr/local/bin/cupcakeFor issues and support:
- GitHub Issues: https://github.com/noatgnu/cupcake/issues
- Documentation: Check the main CUPCAKE documentation
- Logs: Always check service logs when reporting issues
Remember to include relevant log output and system information when reporting issues.