This guide explains how to deploy MultiWikiServer using Docker and Docker Compose.
GitHub Copilot implemented the Docker files, and wrote this page, and we need testers who know Docker
No, seriously. This Docker stuff hasn't been properly tested yet by someone who actually knows docker well, and I've only merged it in to give it visibility.
- Docker Engine 20.10+
- Docker Compose 2.0+ (or docker-compose 1.29+)
MultiWikiServer provides two Docker Compose configurations:
- docker-compose.volume.yml - Uses Docker-managed volumes (simpler, data managed by Docker)
- docker-compose.directory.yml - Uses a local directory bind mount (data easily accessible on host)
Choose the mode that best fits your needs.
This mode uses Docker-managed named volumes for data storage.
-
Download the required files:
curl -O https://raw.githubusercontent.com/TiddlyWiki/MultiWikiServer/main/docker-compose.volume.yml curl -O https://raw.githubusercontent.com/TiddlyWiki/MultiWikiServer/main/Dockerfile
-
Start the container:
docker-compose -f docker-compose.volume.yml up -d
-
Initialize the database (required on first run):
docker-compose -f docker-compose.volume.yml exec mws npx mws init-storeThis creates:
- The default
adminuser with password1234 - Initial database schema
- Default wiki content
- The default
-
Access your wiki:
- Open http://localhost:8080 in your browser
- Default credentials: username
admin, password1234 - Important: Change the default password immediately after first login!
-
View logs:
docker-compose -f docker-compose.volume.yml logs -f mws
-
Stop MWS:
docker-compose -f docker-compose.volume.yml down
Data is stored in a Docker-managed volume named mws-store. This volume contains the store/ directory with your SQLite database and all wikis and tiddlers.
Cache files are ephemeral and regenerated on startup as needed.
This mode uses a local ./store directory for data storage, making it easier to access and backup your data.
-
Create your MWS data directory:
mkdir my-mws-data cd my-mws-data -
Download the required files:
curl -O https://raw.githubusercontent.com/TiddlyWiki/MultiWikiServer/main/docker-compose.directory.yml curl -O https://raw.githubusercontent.com/TiddlyWiki/MultiWikiServer/main/Dockerfile
-
Create the store directory:
mkdir -p store
-
Start the container:
docker-compose -f docker-compose.directory.yml up -d
-
Initialize the database (required on first run):
docker-compose -f docker-compose.directory.yml exec mws npx mws init-storeThis creates:
- The default
adminuser with password1234 - Initial database schema
- Default wiki content
- The default
-
Access your wiki:
- Open http://localhost:8080 in your browser
- Default credentials: username
admin, password1234 - Important: Change the default password immediately after first login!
-
View logs:
docker-compose -f docker-compose.directory.yml logs -f mws
-
Stop MWS:
docker-compose -f docker-compose.directory.yml down
Data is stored in the ./store directory in your current directory. This directory contains your SQLite database and all wikis and tiddlers.
Cache files are ephemeral and regenerated on startup as needed.
The Docker image:
- Uses Node.js 22 Alpine Linux for a small footprint
- Installs the latest stable version of MWS from npm
- Exposes port 8080 by default
The image installs MWS as an npm package, ensuring consistency with the standard Node.js installation.
-
store/ - SQLite database with all your wikis and tiddlers
- Never delete files in this folder! All files are data files.
- Contains the database and all tiddler content
-
cache/ - Cache files (ephemeral)
- Automatically regenerated on startup if missing
- Not persisted in Docker deployments
# Stop the container
docker-compose -f docker-compose.volume.yml down
# Backup the store volume
docker run --rm \
-v multiwikiserver_mws-store:/data/store \
-v $(pwd):/backup \
alpine tar czf /backup/mws-backup-$(date +%Y%m%d).tar.gz /data/store# Stop the container (optional but recommended)
docker-compose -f docker-compose.directory.yml down
# Simply backup the store directory
tar czf mws-backup-$(date +%Y%m%d).tar.gz ./store/For Docker volumes mode:
# Stop the container
docker-compose -f docker-compose.volume.yml down
# Restore the backup
docker run --rm \
-v multiwikiserver_mws-store:/data/store \
-v $(pwd):/backup \
alpine sh -c "cd / && tar xzf /backup/mws-backup-YYYYMMDD.tar.gz"
# Start the container (no need to run init-store again)
docker-compose -f docker-compose.volume.yml up -dFor directory mode:
# Stop the container
docker-compose -f docker-compose.directory.yml down
# Restore the backup
tar xzf mws-backup-YYYYMMDD.tar.gz
# Start the container (no need to run init-store again)
docker-compose -f docker-compose.directory.yml up -d-
Backup your data first! (See backup section above)
-
Update the Docker image:
# For volumes mode docker-compose -f docker-compose.volume.yml down docker-compose -f docker-compose.volume.yml build --no-cache docker-compose -f docker-compose.volume.yml up -d # For directory mode docker-compose -f docker-compose.directory.yml down docker-compose -f docker-compose.directory.yml build --no-cache docker-compose -f docker-compose.directory.yml up -d
-
Check logs for any migration messages:
# For volumes mode docker-compose -f docker-compose.volume.yml logs -f mws # For directory mode docker-compose -f docker-compose.directory.yml logs -f mws
If you have an existing MWS installation and want to migrate to Docker:
-
Create your MWS data directory and copy your store:
mkdir my-mws-data cd my-mws-data # Copy your existing store folder cp -r /path/to/your/mws/store ./
-
Download the required files:
curl -O https://raw.githubusercontent.com/TiddlyWiki/MultiWikiServer/main/docker-compose.directory.yml curl -O https://raw.githubusercontent.com/TiddlyWiki/MultiWikiServer/main/Dockerfile
-
Start the container (no need to run init-store):
docker-compose -f docker-compose.directory.yml up -d
-
Download the required files:
curl -O https://raw.githubusercontent.com/TiddlyWiki/MultiWikiServer/main/docker-compose.volume.yml curl -O https://raw.githubusercontent.com/TiddlyWiki/MultiWikiServer/main/Dockerfile
-
Start the container first to create the volume:
docker-compose -f docker-compose.volume.yml up -d docker-compose -f docker-compose.volume.yml down
-
Copy store folder into the volume:
docker run --rm \ -v multiwikiserver_mws-store:/data/store \ -v /path/to/your/mws:/source \ alpine sh -c "cp -r /source/store/* /data/store/" -
Start the container (no need to run init-store):
docker-compose -f docker-compose.volume.yml up -d
Check logs:
# For volumes mode
docker-compose -f docker-compose.volume.yml logs mws
# For directory mode
docker-compose -f docker-compose.directory.yml logs mwsIf you encounter permission issues with directory mode:
# Fix ownership (adjust UID/GID as needed)
sudo chown -R $(id -u):$(id -g) ./store/If you started the container without running init-store:
# For volumes mode
docker-compose -f docker-compose.volume.yml exec mws npx mws init-store
# For directory mode
docker-compose -f docker-compose.directory.yml exec mws npx mws init-storeWarning: This will delete all your data!
For volumes mode:
# Stop and remove containers
docker-compose -f docker-compose.volume.yml down
# Remove the store volume
docker volume rm multiwikiserver_mws-store
# Start fresh and initialize
docker-compose -f docker-compose.volume.yml up -d
docker-compose -f docker-compose.volume.yml exec mws npx mws init-storeFor directory mode:
# Stop containers
docker-compose -f docker-compose.directory.yml down
# Remove store directory
rm -rf ./store/
# Start fresh and initialize
mkdir -p ./store
docker-compose -f docker-compose.directory.yml up -d
docker-compose -f docker-compose.directory.yml exec mws npx mws init-storeTo enable HTTPS, you'll need to generate or obtain SSL certificates and pass them to MWS:
-
Generate certificates (example using openssl):
openssl req -x509 -nodes -days 365 -newkey rsa:2048 \ -keyout ./certs/key.pem -out ./certs/cert.pem
-
Mount the certificates and modify the command in your docker-compose file:
volumes: - ./store:/data/store - ./certs:/certs:ro command: > sh -c "npx mws listen --listener host=0.0.0.0 port=8080 key=/certs/key.pem cert=/certs/cert.pem secure=true"
To change the exposed port, modify the ports section in your docker-compose file:
ports:
- "3000:8080" # Host port 3000 -> Container port 8080You can set additional environment variables in your docker-compose file:
environment:
- NODE_ENV=production
- TZ=America/New_York # Set timezone