Introduction
In a significant move toward digital sovereignty, Swiss government divisions are migrating from Microsoft 365 to the open-source openDesk platform. This tutorial will guide you through setting up and configuring an openDesk environment using Docker containers, which mirrors the approach many organizations are taking to reduce vendor lock-in and increase control over their digital infrastructure.
This hands-on tutorial demonstrates how to deploy a basic openDesk stack using Docker Compose, which includes Nextcloud for file sharing, OnlyOffice for document editing, and a mail server. Understanding this setup will help you replicate similar deployments in your organization or explore the capabilities of open-source alternatives to proprietary cloud services.
Prerequisites
To follow this tutorial, you'll need:
- A Linux-based server or desktop with at least 4GB RAM
- Docker and Docker Compose installed
- Basic knowledge of command-line operations
- Domain name pointing to your server (optional but recommended)
- Firewall configured to allow HTTP (80) and HTTPS (443) traffic
Step-by-Step Instructions
1. Prepare Your Environment
First, ensure Docker and Docker Compose are installed on your system. Run the following commands to check:
docker --version
compose version
If not installed, follow your system's package manager instructions to install Docker and Docker Compose.
2. Create Project Directory
Create a dedicated directory for your openDesk deployment:
mkdir openDesk-deployment
cd openDesk-deployment
This keeps all configuration files organized and makes it easier to manage your deployment.
3. Create Docker Compose File
Create a docker-compose.yml file with the following content:
version: '3.8'
services:
nextcloud:
image: nextcloud:latest
container_name: nextcloud
restart: unless-stopped
ports:
- "8080:80"
volumes:
- ./nextcloud/data:/var/www/html
environment:
- MYSQL_ROOT_PASSWORD=your_root_password
- MYSQL_PASSWORD=your_db_password
- MYSQL_USER=nextcloud
- MYSQL_DATABASE=nextcloud
depends_on:
- db
db:
image: mariadb:10.5
container_name: nextcloud-db
restart: unless-stopped
environment:
- MYSQL_ROOT_PASSWORD=your_root_password
- MYSQL_PASSWORD=your_db_password
- MYSQL_USER=nextcloud
- MYSQL_DATABASE=nextcloud
volumes:
- ./db/data:/var/lib/mysql
onlyoffice:
image: onlyoffice/document-server:latest
container_name: onlyoffice
restart: unless-stopped
ports:
- "8090:8080"
mailserver:
image: tvial/docker-mailserver:latest
container_name: mailserver
restart: unless-stopped
ports:
- "25:25"
- "587:587"
- "993:993"
volumes:
- ./maildata:/var/mail
- ./maildata/mail-state:/var/mail-state
environment:
- ENABLE_SPAMASSASSIN=1
- ENABLE_CLAMAV=1
- ENABLE_FAIL2BAN=1
- ENABLE_POSTGREY=1
hostname: mail
domainname: yourdomain.com
This configuration sets up the core components of an openDesk environment. The Nextcloud service provides file sharing, OnlyOffice enables document editing, and the mail server handles email services.
4. Initialize Database and Mail Directories
Create the necessary directories for data persistence:
mkdir -p db/data nextcloud/data maildata
This ensures that your data persists even if containers are removed or updated.
5. Start the Services
Launch all services with Docker Compose:
docker-compose up -d
The -d flag runs containers in detached mode, allowing you to continue using your terminal.
6. Configure Nextcloud
Access Nextcloud at http://your-server-ip:8080. Complete the initial setup by creating an admin user and configuring the database connection. Nextcloud will automatically detect your MariaDB service.
This step is crucial as it establishes your file sharing infrastructure, which is a core component of any openDesk environment.
7. Configure OnlyOffice Integration
Install the OnlyOffice integration app in Nextcloud by:
- Navigating to the Nextcloud Apps section
- Searching for "OnlyOffice"
- Installing the application
This integration allows collaborative document editing without relying on proprietary Microsoft Office services.
8. Test Mail Server
Verify that your mail server is functioning:
docker-compose logs mailserver
Check for any errors and ensure the service is running properly. You can also test email sending by using a mail client configured to use your server.
9. Secure Your Deployment
For production use, implement HTTPS using Let's Encrypt:
docker-compose run --rm -p 80:80 -p 443:443 certbot/certbot certonly --standalone --email [email protected] --agree-tos --no-eff-email --domain yourdomain.com
This step is essential for protecting user data and ensuring secure communication across your openDesk platform.
Summary
This tutorial demonstrated how to deploy an openDesk environment using Docker containers, providing a foundation for organizations looking to migrate from proprietary cloud services like Microsoft 365. By following these steps, you've set up a file sharing system with document editing capabilities and email services using open-source tools.
The key benefits of this approach include reduced vendor lock-in, increased control over data, and the ability to customize services to meet specific organizational needs. This setup mirrors the kind of infrastructure that Swiss government divisions are implementing to achieve digital sovereignty.
Remember to regularly update your containers, monitor logs for security issues, and implement proper backup strategies for your critical data.



