Building OnlyOffice with Docker Compose allows you to configure a document collaboration system in just 5 minutes! πβοΈ This guide details everything about building container-based OnlyOffice.
—.
π What is OnlyOffice?
An open source based integrated office solution:
- Real-time document collaboration (word/spreadsheet/presentation)
- MS Office compatible (docx, xlsx, pptx)
- Cloud storage integration (Nextcloud, OwnCloud, etc.)
- Mobile support
—.
βοΈ Required Prerequisites
- complete Docker and Docker Compose installation
# Check the installation docker --version && docker-compose --version
- 4GB or more memory (official recommended specification)
- open port 80/443 (or use a custom port)
—.
π³ Analyze Docker Compose files (with comments)
version: '3' # Docker Compose version
services:
onlyoffice:
image: onlyoffice/documentserver:7.4 # Official image
container_name: onlyoffice_ds
restart: unless-stopped # Set up automatic restarts
ports:
- "8000:80" # host:container port mapping.
- "8443:443" # when using HTTPS
volumes:
- ./onlyoffice_data:/var/www/onlyoffice/Data # Save configuration file.
- ./onlyoffice_logs:/var/log/onlyoffice # Save logs
environment:
- JWT_ENABLED=true # Enable security token.
- JWT_SECRET=my_super_secret_key # Secret key for token generation
- DB_TYPE=postgres # Database type
depends_on:
- postgres
postgres: # OnlyOffice dedicated DB
image: postgres:13
container_name: onlyoffice_db
restart: unless-stopped
volumes:
- ./pg_data:/var/lib/postgresql/data # Persistent storage of DB data
environment:
POSTGRES_DB: onlyoffice
POSTGRES_USER: onlyoffice
POSTGRES_PASSWORD: onlyoffice_pass
—.
π οΈ Step-by-step deployment guide
-
create a working directory
mkdir onlyoffice && cd onlyoffice
-
create a
docker-compose.yml
file Copy and save the example above -
Run the service π.
docker-compose up -d
(Image: Container execution screen) (Image: Container execution screen)
-
**Confirm initialization
docker-compose logs -f # Monitor logs
—]
π Set core environment variables
Variable name | Default value | Description |
---|---|---|
JWT_ENABLED |
true | Enable API security |
JWT_SECRET |
– | Secret for token signing |
DB_HOST |
postgres | Database hostname |
AMQP_URI |
– | Used for RabbitMQ integration |
WOPI_ENABLED |
true | Enable Web Office integration |
—]
π Connecting and testing OnlyOffice
- access
http://μλ²IP:8000
in a web browser - Check the Welcome page
- edit a test document:
http://μλ²IP:8000/example
—.
β οΈ Troubleshooting Key Tips
- Document not saved: **Document not saved
β Check the volume mount permission:
chmod -R 755 ./onlyoffice_data
- “Document Server is not responding” β Check the volume mounting permission:
chmod -R 755 ./onlyoffice data
β Check DB container running normally:docker-compose ps
- **HTTPS error
β Set Nginx reverse proxy recommendation:
location / { proxy_pass http://localhost:8000; proxy_set_header Host $host; }
—]
π‘ Advanced setup tips
- integrate Let’s Encrypt.
Use certbot after mapping
- "443:443"
port - **Cloud storage integration
Set
APP_URL
environment variable when integrating Nextcloud - backup strategy
Periodic backup of
./onlyoffice_data
,./pg_data
directory
—]
β Conclusion: Why OnlyOffice with Docker?
- Fast deployment in 5 minutes β±οΈ
- Easy to update β
docker-compose pull && docker-compose up -d
- zero compatibility issues** οΏ½
- resource efficient (70% β resource usage compared to traditional VMs)
> “Built with Docker Compose, OnlyOffice is a modern document collaboration platform for any size, from small businesses to university campus solutions!”
Start your own OnlyOffice server now! π Experience for yourself how a container-based office environment can revolutionize the way you work. D