Run XWiki (MySQL on Tomcat) Using Docker Compose
Last modified by Eleni Cojocariu on 2026/04/29 12:36
Steps
To run XWiki using Docker Compose with a MySQL + Tomcat setup:
- Create a working directory, for example /xwiki.
- Go to the /xwiki directory.
- Download the required configuration files:Don't forget to replace <cycle_version> with the actual XWiki cycle version you want. For example:
- Run the following commands with
wget:wget https://raw.githubusercontent.com/xwiki/docker-xwiki/master/<cycle_version>/mysql-tomcat/mysql/init.sqlwget https://raw.githubusercontent.com/xwiki/docker-xwiki/master/<cycle_version>/mysql-tomcat/docker-compose.ymlwget https://raw.githubusercontent.com/xwiki/docker-xwiki/master/<cycle_version>/mysql-tomcat/.env
- Or, if you prefer to use
curl:curl -fSL https://raw.githubusercontent.com/xwiki/docker-xwiki/master/<cycle_version>/mysql-tomcat/mysql/init.sql -o init.sqlcurl -fSL https://raw.githubusercontent.com/xwiki/docker-xwiki/master/<cycle_version>/mysql-tomcat/docker-compose.yml -o docker-compose.ymlcurl -fSL https://raw.githubusercontent.com/xwiki/docker-xwiki/master/<cycle_version>/mysql-tomcat/.env -o .env
curl -fSL https://raw.githubusercontent.com/xwiki/docker-xwiki/master/17/mysql-tomcat/mysql/init.sql -o init.sql - Run the following commands with
- Run Docker Compose to pull the images and start the containers:
docker compose up -d.
FAQ
How can I check that XWiki is running?
Run: docker ps. If XWiki is running correctly, you should see active containers and their id's for XWiki and MySQL.
How to open a bash session?
Run: docker exec -it <containerid> bash -l. This will open a bash session inside the MySQL container, allowing you to interact with the container's environment.
How to connect to MySQL inside the container?
Run: mysql --user=xwiki --password=xwiki. This command will connect you to the MySQL instance inside the container using the xwiki user and the xwiki password.
What are the files init.sql, docker-compose.yml, .env used for?
These are some required files for XWiki Docker Compose.