This guide uses Docker Compose to run ONLYOFFICE Document Server in containers. ONLYOFFICE Docs is a collaborative document editor (like Google Docs) that integrates with platforms like Nextcloud and ownCloud.
For Docker installation, see Docker.
Create a docker-compose.yml file with the following content:
version: '3.8'
services:
onlyoffice:
image: onlyoffice/documentserver:latest
container_name: onlyoffice-document-server
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- ./logs:/var/log/onlyoffice
- ./data:/var/www/onlyoffice/Data
- ./lib:/var/lib/onlyoffice
- ./db:/var/lib/postgresql
environment:
- JWT_ENABLED=true
- JWT_SECRET=your-secure-random-secret-min-32-chars
- DB_TYPE=postgres
- DB_HOST=localhost
- DB_PORT=5432
- DB_NAME=onlyoffice
- DB_USER=onlyoffice_user
- DB_PWD=your-secure-database-password
Security Note: Replace the following before deployment:
your-secure-random-secret-min-32-chars - Generate with: openssl rand -hex 32your-secure-database-password - Strong database passworddocker compose up -d
Wait for the container to start (approximately 2-3 minutes for first run).
Open http://YOUR-SERVER to access the Document Server welcome page.
Test the installation by accessing the health check endpoint:
curl http://YOUR-SERVER/webapps/hello
You should see “ONLYOFFICE Document Server” response.
For production deployments:
/var/www/onlyoffice/Data and databaseTo integrate with Nextcloud or ownCloud:
https://docs.example.com)For production, use an external PostgreSQL database:
environment:
- DB_TYPE=postgres
- DB_HOST=your-db-server
- DB_PORT=5432
- DB_NAME=onlyoffice
- DB_USER=onlyoffice_user
- DB_PWD=your-secure-password
See Configuration and Security for production hardening.
Any questions?
Feel free to contact us. Find all contact information on our contact page.