This guide explains how to build and run ONLYOFFICE DocumentServer from source using Docker on your MacBook.
- Docker Desktop for Mac
- Docker Compose
- At least 8GB RAM allocated to Docker
- 40GB free disk space
# Build the Docker image and start all services
docker-compose up --buildThis will:
- Build the DocumentServer from source
- Start PostgreSQL database
- Start RabbitMQ message broker
- Start all DocumentServer services
- Expose the application on http://localhost:8080
Once all services are running, access DocumentServer at:
- DocumentServer: http://localhost:8080
- RabbitMQ Management: http://localhost:15672 (guest/guest)
The source code is mounted as volumes in the container, so you can edit files directly on your Mac:
./core- C++ core components./server- Node.js backend services./web-apps- Frontend web applications./sdkjs- JavaScript SDK
# Rebuild sdkjs
docker-compose exec documentserver sh -c "cd /app/DocumentServer/sdkjs && make"
# Rebuild web-apps
docker-compose exec documentserver sh -c "cd /app/DocumentServer/web-apps && make"
# Rebuild server
docker-compose exec documentserver sh -c "cd /app/DocumentServer/server && make"
# Restart services
docker-compose restart documentserverFor core C++ changes, you'll need to rebuild using build_tools:
# Enter the container
docker-compose exec documentserver bash
# Navigate to build_tools
cd /build_tools/tools/linux
# Rebuild
python3 automate.py server
# Exit and restart
exit
docker-compose restart documentserver# All services
docker-compose logs -f
# Specific service
docker-compose logs -f documentserver
# Inside container logs
docker-compose exec documentserver tail -f /var/log/onlyoffice/documentserver/docservice.logdocker-compose downdocker-compose down -vdocker-compose exec documentserver bashdocker-compose exec documentserver supervisorctl statusdocker-compose exec documentserver supervisorctl restart docservice
docker-compose exec documentserver supervisorctl restart converter
docker-compose exec documentserver supervisorctl restart spellchecker- DocService (port 8000) - Main document service
- FileConverter - Converts documents between formats
- SpellChecker - Spell checking service
- Metrics - Monitoring and metrics
- NGINX (port 80) - Reverse proxy
- PostgreSQL (port 5432)
- Database: onlyoffice
- User: onlyoffice
- Password: onlyoffice
- RabbitMQ (ports 5672, 15672)
- User: guest
- Password: guest
Check logs:
docker-compose logs documentserverIncrease Docker memory allocation in Docker Desktop preferences to at least 8GB.
Change ports in docker-compose.yml:
ports:
- "9090:80" # Change 8080 to 9090 or any available portClean build and retry:
docker-compose down -v
docker-compose build --no-cache
docker-compose upWait for PostgreSQL to fully start (check logs):
docker-compose logs postgres- First build will take 30-60 minutes depending on your Mac's specs
- Subsequent builds will be faster (5-10 minutes)
- Use
docker-compose up -dto run in detached mode - The source code volumes allow instant code changes without rebuild (for interpreted languages like JavaScript)
After making code changes:
-
For JavaScript/Node.js changes (server, web-apps, sdkjs):
- Run the appropriate
makecommand - Restart the service with supervisorctl
- Run the appropriate
-
For C++ changes (core):
- Rebuild with build_tools
- Full container restart required
-
Test your changes at http://localhost:8080
For a production-ready build without development features:
docker build -f Dockerfile -t onlyoffice-documentserver-custom .
docker run -p 8080:80 onlyoffice-documentserver-custom