Skip to content

Install

Run Wonkru MDM on one server with the published Docker image. The installer starts the admin panel, API, PostgreSQL, and Caddy. For a local installation on a Mac, use Docker Desktop.

On Ubuntu and Debian, the installer installs Docker from the official APT repository if needed. If Docker is already installed, use Compose 2.24.4 or later.

The figures below are starting points for a Linux server running the published image, PostgreSQL, and Caddy on the same machine. Use a 64-bit amd64 or arm64 server.

Resource Small deployment Recommended for daily use
CPU 1 vCPU 2 vCPUs
RAM 2 GB 4 GB
SSD 20 GB 40 GB

On macOS, Docker Desktop requires at least 4 GB of host RAM. Docker Desktop requirements

Use this option when the panel or Android devices connect over the internet. Point both DNS names to your server. If you publish an IPv6 record, make sure the server is reachable at that address too. Keep port 80 reachable from the internet so Caddy can complete HTTP certificate validation. Use port 443 for the panel and API. Choose HTTPS when prompted or pass the values below. Caddy certificate validation

Terminal window
curl -fsSL https://wonkrumdm.com/install.sh | sudo bash -s -- \
--api-host api.example.com \
--panel-host app.example.com \

Open https://app.example.com with your actual panel domain. The installer prints that address at the end. The app uses port 443 for both domains.

You can use your own CA with a local IP address or a private DNS name. The TLS guide covers creating the certificates, configuring Caddy, and enrolling Android devices. HTTPS with your own TLS certificate

Use HTTP on a trusted local network. When the installer asks how to connect, press Enter to choose HTTP. It shows the detected IPv4 address and suggests port 8080 for the API and 8082 for the panel. Press Enter to keep each value or type your own.

Terminal window
curl -fsSL https://wonkrumdm.com/install.sh | sudo bash

If the detected address is out of reach for your devices or the default ports are in use, set them in the first install command. Replace the example IP with your server’s reachable address.

Terminal window
curl -fsSL https://wonkrumdm.com/install.sh | sudo bash -s -- \
--host 192.168.1.20 --api-port 9080 --panel-port 9082

With these values, open http://192.168.1.20:9082 for the panel. The devices connect to http://192.168.1.20:9080.

Start Docker Desktop and run the command in Terminal as your normal user.

Terminal window
curl -fsSL https://wonkrumdm.com/install.sh | bash -s -- \
--dir "$HOME/wonkru-mdm"

Choose HTTP and accept the default values for a local installation. Open http://localhost:8082. The API is at http://localhost:8080. With the default settings, both addresses are available only on the Mac. See change the HTTP ports or address to let devices on your local network connect.

Open the panel, create your admin account, and sign in. The first account requires no email code or SMTP settings. Enable two-factor authentication and store the recovery codes in a safe place. Set the panel time zone under Settings.

For password resets by email on a self-hosted installation, enable SMTP under Settings → SMTP and send a test email from that page. You can recover an admin account from the server terminal if you lose access to email.

If you forget your password or lose access to your authenticator app, recover your account from a terminal on the server. The command connects directly to the database. It works while the panel and API are offline.

Terminal window
cd /opt/wonkru-mdm
# Password only
docker compose exec server ./bin/server admin passwd --email [email protected]
# The account is missing entirely
docker compose exec server ./bin/server admin passwd --email [email protected] --create
# The authenticator device is also lost
docker compose exec server ./bin/server admin passwd --email [email protected] --clear-totp
# List admins and their 2FA state
docker compose exec server ./bin/server admin list

The command prompts for the new password twice. As you type, the terminal hides the characters and keeps the password out of command history. In scripts, pass the password via stdin with --password-stdin and add -T to docker compose exec. Use --keep-sessions to keep active sessions. With --create, --grant-admin, or --clear-totp, confirm when prompted or use --yes in a script. If the container is stopped, replace exec with run --rm --no-deps --entrypoint ./bin/server server.

On macOS, replace /opt/wonkru-mdm with your installation directory. To clear 2FA this way, you need access to the server terminal and Docker.

The installer generates a unique password for the Starter policy’s on-device IT page. Read STARTER_ADMIN_PASSWORD from the installation’s .env on the server.

Terminal window
sudo grep '^STARTER_ADMIN_PASSWORD=' /opt/wonkru-mdm/.env

On macOS, use grep with the path to your installation directory. To change the device password after setup, edit Policies → Starter → General → Admin Password in the panel. The .env value holds the initial password.

The first installation includes the Starter policy, the signed Wonkru MDM app, and a Wonkru MDM provisioning profile.

  • Enroll from the app. In the dashboard, select Download MDM APK. In the agent’s setup screen, enter your API address and the enrollment key from Settings, or use the in-app scanner to scan the enrollment QR code.
  • Set up Device Owner mode. Open Provisioning Profiles → Wonkru MDM. Under Setup Wi-Fi network, enter the SSID and security type for a network the device can use to reach the API and download the APK. Enter the password for WPA or WEP, or select Open network for a network without a password. Enable Hidden network if the network hides its SSID. Save the profile once the QR code appears. On a new or factory-reset device, tap the same spot on the welcome screen six times, then scan the code. This QR code contains the enrollment key and the Wi-Fi details you entered. Share it only with the people setting up devices. Android QR provisioning

Android connects to Wi-Fi before downloading the APK. When Wonkru opens, grant the requested permissions and select Continue setup. The device appears under Devices with the default policy. For an EAP network, select the EAP method and enter any additional authentication details in raw JSON. Android Wi-Fi provisioning fields

To offer a different APK, upload it under Applications and choose its package in Settings → MDM APK package name. The download and default profile use the active default version, or the highest active version with an APK if no default is available. See Agent APK for signing and updates.

Add options after sudo bash -s -- on Linux or bash -s -- on macOS.

Option What it sets Default
--dir DIRECTORY Where the installer saves Compose files and settings. Also accepted with update. /opt/wonkru-mdm on Linux, $HOME/wonkru-mdm on macOS
--host HOST Address clients use in HTTP mode. Use an IPv4 address or hostname. Detected IPv4 on Linux, localhost on macOS
--api-port PORT Port devices and the panel use to reach the API in HTTP mode. 8080
--panel-port PORT Port you open in your browser in HTTP mode. 8082
--api-host DOMAIN API domain for HTTPS, without https:// or a port. Set together with --panel-host and --email
--panel-host DOMAIN Panel domain for HTTPS. Use a different name from the API domain. Set together with --api-host and --email
--email EMAIL Contact email for Caddy’s certificate account. Set together with the two HTTPS domains
--non-interactive Skip installation questions. Use this in scripts and automation. First install prompts for missing values when a terminal is available

Options you pass skip their prompts. Any HTTPS option selects HTTPS. For example, if you pass only --api-host, the installer asks for the panel domain and email. With --non-interactive or without a terminal, it uses the HTTP defaults or tells you which required HTTPS option is missing. An existing installation reads .env, and update skips setup questions.

Port options apply to the first HTTP installation. Edit .env to change ports later. The standard HTTPS setup uses ports 80 and 443. See the detailed guide for custom TLS and proxy layouts.

On Linux, run sudo -i in your terminal and edit .env in the installation directory. If you used --dir, substitute that path.

Terminal window
sudo -i
cd /opt/wonkru-mdm
nano .env

On macOS, open Terminal as your normal user, go to the directory you chose, and run nano .env.

Change these lines to move the API to 9080 and the panel to 9082. To change just the panel port, edit WEB_PORT, WEB_PUBLIC_PORT, and PANEL_ORIGIN. Use your own server address in the host and URL values. If you use the panel only on your Mac, keep localhost.

API_PORT=9080
API_PUBLIC_HOST=192.168.1.20
API_PUBLIC_PORT=9080
APP_URL=http://192.168.1.20:9080
WEB_PORT=9082
WEB_PUBLIC_HOST=192.168.1.20
WEB_PUBLIC_PORT=9082
PANEL_ORIGIN=http://192.168.1.20:9082

Keep API_SITE and WEB_SITE as they are. They tell Caddy which ports to listen on inside Docker. If either public HTTP port is 80, leave :80 out of its URL. To allow LAN access on a Mac, also set HTTP_BIND_IP=0.0.0.0, use the Mac’s LAN address above, and limit access to your trusted network.

Save the file and apply the changes in the same directory.

Terminal window
docker compose up -d

Open the new panel URL and update any firewall rules for the old ports. The new API address appears in new enrollment QR codes. Devices that already use the old address need to be updated if that address stops working.

Back up your database, uploaded files, and .env, then run the update command on the machine where Wonkru MDM is installed.

On Ubuntu or Debian, the updater looks in /opt/wonkru-mdm. Omit sudo if you are already root.

Terminal window
curl -fsSL https://wonkrumdm.com/install.sh | sudo bash -s -- update

On macOS, the updater looks in $HOME/wonkru-mdm.

Terminal window
curl -fsSL https://wonkrumdm.com/install.sh | bash -s -- update

If you chose a custom installation directory, add --dir "/path/to/installation" after update. The updater downloads the current Compose files and image. It keeps your addresses, secrets, and persistent Docker data. It saves the previous configuration under .wonkru-backups/ and prints the panel address when the services are ready. Back up the database and uploads using the steps below.

Update the server and Android agent separately. When distributing a new APK, keep the package name and signing key and increase versionCode. Android app updates

Run these commands from the installation directory. On Linux, use sudo -i if needed.

Terminal window
docker compose ps
docker compose logs --tail 80 server caddy

Back up the database, uploads, and installation settings during the same maintenance window.

Terminal window
(
set -e
umask 077
backup_dir="$(mktemp -d ./wonkru-backup.XXXXXX)"
cp .env docker-compose.yaml docker-compose.override.yaml Caddyfile "$backup_dir/"
docker compose exec -T postgres pg_dump -U postgres wonkru_mdm > "$backup_dir/wonkru-db.sql"
docker compose exec -T server tar -czf - -C /app/storage . > "$backup_dir/wonkru-storage.tgz"
printf 'Backup directory: %s\n' "$backup_dir"
)

Also back up docker-compose.local.yaml and any custom TLS files if you use them. With tls internal, back up Caddy’s caddy_data volume. Store the backup off the server in a place only authorized people can access. Keep the original secrets and keys in .env so existing two-factor authentication and signed download links continue to work after a restore.

docker compose down -v deletes the database and uploaded files. For port and access errors, see Troubleshooting.

For a custom build, follow build from source.