This guide uses Docker Compose to run XWiki in containers. XWiki is a free open-source collaborative wiki platform for structured knowledge management.
For Docker installation, see Docker.
Create a docker-compose.yml file with the following content:
version: '2'
services:
xwiki:
image: xwiki:stable-mysql-tomcat
container_name: xwiki
restart: unless-stopped
ports:
- "8080:8080"
environment:
- DB_HOST=db
- DB_USER=xwiki
- DB_PASSWORD=your-db-password
- DB_DATABASE=xwiki
volumes:
- xwiki-data:/usr/local/xwiki
depends_on:
- db
db:
image: mysql:9.1
container_name: xwiki-db
restart: unless-stopped
environment:
- MYSQL_ROOT_PASSWORD=your-root-password
- MYSQL_USER=xwiki
- MYSQL_PASSWORD=your-db-password
- MYSQL_DATABASE=xwiki
command:
- "--character-set-server=utf8mb4"
- "--collation-server=utf8mb4_bin"
volumes:
- mysql-data:/var/lib/mysql
volumes:
xwiki-data:
mysql-data:
Security Note: Replace the following before deployment:
your-db-password - Strong database passwordyour-root-password - Strong MySQL root passworddocker compose up -d
Wait for the containers to start (approximately 2-3 minutes for first run).
Open http://YOUR-SERVER:8080 to access XWiki.
On first access, you’ll be guided through the installation wizard:
For production deployments:
latestFor production, PostgreSQL is recommended over MySQL:
services:
xwiki:
image: xwiki:stable-postgres-tomcat
environment:
- DB_HOST=postgres
- DB_USER=xwiki
- DB_PASSWORD=your-db-password
- DB_DATABASE=xwiki
postgres:
image: postgres:15
environment:
- POSTGRES_USER=xwiki
- POSTGRES_PASSWORD=your-db-password
- POSTGRES_DB=xwiki
After installation, configure SMTP in the XWiki admin panel:
For large wikis, increase Java heap size:
environment:
- JAVA_OPTS=-Xmx2g -Xms512m
See Configuration and Security for production hardening.
Any questions?
Feel free to contact us. Find all contact information on our contact page.