Overview
This guide covers running DataForeman with Docker Compose. There are two ways to install it, depending on whether you want prebuilt images or your own local builds:
- Prebuilt images (recommended for most users) — no
gitrequired, just three downloaded files. Updates are a simpledocker compose pull. See the Download page for the exact commands. - Git clone / build from source — for developers who want to modify the code or track
developdirectly. Usesnpm start, which buildscore,front,connectivity, andbrokerlocally viadocker-compose.dev.yml.
This guide focuses on the git clone method, since the prebuilt-image quick start is already covered on the Download page.
Prerequisites
Before you begin, ensure your system meets the following requirements:
- Docker 20.10 or higher
- Docker Compose 2.0 or higher
- Node.js 22+ and Git (for the git-clone method described here)
- Operating System: Linux, macOS, or Windows with WSL2
- Minimum Resources:
- 4 GB RAM (8 GB recommended)
- 20 GB available disk space
- 2 CPU cores minimum
Quick Start
The fastest way to get DataForeman running from a git clone:
|
|
npm start builds the images locally the first time (via docker-compose.dev.yml) and starts the full stack.
Access the application at http://localhost:8080
Default credentials:
- Email:
ADMIN_EMAIL(default:admin@example.com) - Password: from
ADMIN_PASSWORDin.env(default:password)
⚠️ Important: Change the default password immediately after first login!
Installation Steps
1. Clone the Repository
|
|
2. Configure Environment Variables
Create a .env file from the template:
|
|
Edit .env to customize your installation. The most important values to change:
|
|
Note:
PGHOST=dbandTSDB_HOST=tsdbrefer to Docker Compose service names — leave them as-is for a standard Docker deployment.
3. Start the Services
Launch all containers in detached mode:
|
|
npm start automatically runs fix-permissions.sh before starting containers, so no separate permission step is needed. Permissions fix the logs/ and var/ directories that containers write to.
4. Verify Installation
Check that all services are running:
|
|
You should see all services in the “Up” state.
What’s Included
The Docker Compose setup includes the following services:
| Service | Name in Compose | Description |
|---|---|---|
| PostgreSQL | db |
Main application database |
| TimescaleDB | tsdb |
Time-series data storage |
| NATS | nats |
Internal message bus |
| Core API | core |
Backend API and flow engine |
| Connectivity | connectivity |
Protocol drivers (OPC UA, EtherNet/IP, S7, MQTT) |
| Frontend | front |
React web interface |
| MQTT Broker | broker |
Embedded MQTT broker for device connectivity |
| Log Rotation | rotator |
Automated log management |
| Caddy | caddy |
Optional HTTPS reverse proxy (enabled with --with-caddy) |
Configuration
Port Configuration
Default ports used by DataForeman:
| Service | Port | Purpose |
|---|---|---|
| Frontend | 8080 | Web interface |
| API | 3000 | REST API (localhost only) |
| PostgreSQL | 5432 | Main database (localhost only) |
| TimescaleDB | 5433 | Time-series database (localhost only) |
| NATS | 4222 | Message bus (localhost only) |
| MQTT Broker | 1883 | MQTT |
| MQTT Broker | 8081 | WebSocket |
To change ports, edit the .env file and restart:
|
|
Volume Management
Data is persisted in Docker named volumes. Docker prefixes volumes with the project name (dataforeman):
|
|
Upgrades
Upgrade to Latest Version (git clone install)
Since this install builds images locally from source, updating means pulling the new code and rebuilding:
-
Check GitHub Releases for the latest version tag (e.g.
vX.X.X) -
Fetch and check out the new version:
|
|
- Rebuild and restart:
|
|
Database migrations run automatically when core starts — no manual migration step is needed. Your data (databases, dashboards, configurations) is preserved.
To roll back:
git checkout vX.X.X && npm run start:rebuild
Prebuilt-image installs: if you followed the Download page’s curl-based setup instead, updating is simpler — just
docker compose pull && docker compose up -d. Nogitneeded.
Database Migrations
Migrations run automatically on startup. Check logs:
|
|
Backup and Restore
Backup Database
Create a backup of the main PostgreSQL database:
|
|
Restore Database
Restore from a backup file:
|
|
Backup Volumes
Backup the main database volume:
|
|
Troubleshooting
Services Won’t Start
Check logs:
|
|
Check specific service:
|
|
Port Already in Use
If port 8080 is already in use by another application:
- Edit
.envand changeFRONT_PORTto a different value (e.g.FRONT_PORT=8090) - Restart:
docker compose down && docker compose up -d
Database Connection Issues
Reset database:
|
|
⚠️ Warning: This deletes all data!
Permission Denied Errors
Run the permission fix script:
|
|
This script fixes permissions on the logs/ and var/ directories that containers write to. It also sets logs/postgres/ to world-writable so the PostgreSQL container (which runs as a different UID) can write its log files.
Container Keeps Restarting
Check container logs for errors:
|
|
Common issues:
- Insufficient memory (increase Docker memory limit)
- Missing environment variables (check
.env) - Port conflicts (change ports in
.env)
Getting Help
If you encounter issues:
- Check the Troubleshooting section
- Review logs:
docker compose logs - Visit GitHub Discussions
- Report bugs on GitHub Issues