Run Uptime Kuma and MariaDB as two services in one Docker Compose project. Uptime Kuma connects to the database at the Compose service name db on port 3306, while named volumes preserve both the application data and MariaDB files across restarts.
Antihost offers Linux VPS plans with full root access, unlimited traffic on a 1 Gbps port and a 14-day free trial.
The configuration below uses Docker secrets for passwords, creates the MariaDB database and user on first launch, and mounts the persistent paths required by both containers.
As an Amazon Associate I earn from qualifying purchases.
What this deployment contains
The stack has an app service running Uptime Kuma and a db service running MariaDB. Compose creates a private network for the project, so the application reaches MariaDB by DNS name db. Do not use localhost in Uptime Kuma’s database hostname: inside the app container, localhost refers to that same container, not the MariaDB service.
Prerequisites
- Docker Engine with the Compose plugin and permission to run
docker compose. - A host directory where the Compose file and secret files can be protected from other users.
- TCP port 3001 available on the host, or another host port that you map to container port 3001.
- Enough storage for two persistent volumes and a backup copy of each.
A secure Docker Compose file
Save this as compose.yaml. The Uptime Kuma image uses the major :2 tag in the official installation example; the MariaDB example uses mariadb:11.7. Review image releases and pin versions according to your change-control policy rather than silently accepting an unreviewed update.
#1 Best Overall
- [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
- [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
- [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
- [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
- [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.
services:
app:
image: louislam/uptime-kuma:2
ports:
- "3001:3001"
volumes:
- uptime_kuma_data:/app/data
environment:
UPTIME_KUMA_DB_TYPE: mariadb
UPTIME_KUMA_DB_HOSTNAME: db
UPTIME_KUMA_DB_PORT: 3306
UPTIME_KUMA_DB_NAME: kuma
UPTIME_KUMA_DB_USERNAME: kuma
UPTIME_KUMA_DB_PASSWORD_FILE: /run/secrets/db_password
depends_on:
- db
secrets:
- db_password
db:
image: mariadb:11.7
environment:
MYSQL_ROOT_PASSWORD_FILE: /run/secrets/db_root_password
MYSQL_PASSWORD_FILE: /run/secrets/db_password
MYSQL_USER: kuma
MYSQL_DATABASE: kuma
volumes:
- mariadb_data:/var/lib/mysql
secrets:
- db_password
- db_root_password
volumes:
uptime_kuma_data:
mariadb_data:
secrets:
db_password:
file: ./secrets/db_password
db_root_password:
file: ./secrets/db_root_password
There is deliberately no ports entry for MariaDB. The database is reachable by other services on Compose’s internal network, but is not published directly on the host. If another machine must connect for administration, add a controlled firewall rule and a host mapping only for that use case.
Prepare password files and start the stack
- Create the project directories. For example, make a directory for the Compose file and a
secretssubdirectory beneath it. - Create two different strong passwords. Put the application user’s password in
secrets/db_passwordand the MariaDB root password insecrets/db_root_password. Keep each file to the password value, normally followed by a newline. - Restrict host permissions. Set both files so only the account that runs Compose can read them, and do not commit them to source control or include them in support bundles.
- Launch the services. From the directory containing
compose.yaml, rundocker compose up -d. - Watch startup output. Use
docker compose logs -f dband, in another terminal,docker compose logs -f app. Wait for MariaDB to finish initialization before diagnosing an application connection error. - Open the web interface. Browse to
http://HOSTNAME-OR-IP:3001(or the host port you selected) and complete Uptime Kuma’s first-run account setup.
depends_on expresses startup order, not database readiness. MariaDB may still be creating its system tables when the app container starts. A transient connection error can clear after the database reports that it is ready; if the app does not reconnect, restart only the app with docker compose restart app after confirming the database logs are healthy.
Recommended Free Tools
Rank #2
- 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
- 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
- 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
- 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
- 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.
Uptime Kuma database variables
These variables tell Uptime Kuma how to form its MariaDB connection. The values must match the database service’s initialization settings and the network name in the Compose project.
| Variable | Value in this example | Purpose |
|---|---|---|
UPTIME_KUMA_DB_TYPE |
mariadb |
Selects MariaDB instead of SQLite. |
UPTIME_KUMA_DB_HOSTNAME |
db |
Compose DNS name of the MariaDB service. |
UPTIME_KUMA_DB_PORT |
3306 |
MariaDB’s normal container port. |
UPTIME_KUMA_DB_NAME |
kuma |
Database schema Uptime Kuma uses. |
UPTIME_KUMA_DB_USERNAME |
kuma |
Application database account. |
UPTIME_KUMA_DB_PASSWORD_FILE |
/run/secrets/db_password |
Reads the password from a mounted secret instead of putting it directly in YAML. |
Uptime Kuma also documents optional SSL and connection-pool settings. The environment-variable table includes UPTIME_KUMA_DB_POOL_MAX_CONNECTIONS, whose default is 10; increase it only when monitoring workload and MariaDB capacity justify more simultaneous connections. The documentation also provides _FILE forms for sensitive password, username and CA values. Use the exact variable names supported by the Uptime Kuma version you deploy when enabling certificate verification or supplying those values.
Rank #3
- [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
- [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
- [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
- [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
- [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by
MariaDB initialization variables
On an empty data directory, the MariaDB image uses these settings to create the database and application account:
| Variable | Value in this example | Effect |
|---|---|---|
MYSQL_DATABASE |
kuma |
Creates the named database. |
MYSQL_USER |
kuma |
Creates the non-root application user. |
MYSQL_PASSWORD_FILE |
/run/secrets/db_password |
Sets that user’s password from the mounted secret. |
MYSQL_ROOT_PASSWORD_FILE |
/run/secrets/db_root_password |
Sets the root password from a separate secret. |
Initialization is a first-start operation. Once mariadb_data contains a database directory, changing MYSQL_DATABASE, MYSQL_USER or either password file does not rewrite the existing data or create a replacement account. This behavior protects existing databases but often surprises people who edit Compose and expect credentials to change immediately. Change an existing account inside MariaDB using an administrative procedure, or deliberately migrate to a new empty volume after making and verifying a backup. Never remove a production volume merely to make an environment-variable change take effect.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Clear out junk files and repair common Windows errors3Scan for outdated or missing drivers - takes under a minuteRank #4
- Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
- Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
- All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
- Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
- Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.
Persistence and backup design
Keep both named-volume mounts:
uptime_kuma_data:/app/datastores Uptime Kuma’s application state. Without it, recreating the app container can remove configuration, users and monitor data.mariadb_data:/var/lib/mysqlstores MariaDB’s database files. Without it, the database is recreated from scratch when the container is replaced.
Back up both volumes as one logical deployment. A database dump protects SQL records and is useful for migrations; a copy or snapshot of the Uptime Kuma data volume protects application-side files. Record which image versions and Compose file were used with each backup, and test restoration on an isolated project before upgrading. A backup that covers only MariaDB can still leave the restored Uptime Kuma instance without matching application data, while a backup of only /app/data cannot recreate the SQL database.
Verify the connection before changing settings
Check service state and logs
Run docker compose ps to confirm both containers are running. MariaDB’s first boot takes longer than later starts because it initializes system tables and the requested database. Read the database log for its ready message, then inspect the app log for authentication or hostname errors. If the database repeatedly exits, fix that service first; Uptime Kuma cannot establish a connection to a stopped database.
Best Value
Hostname or port errors
Use db as the hostname and 3306 as the container port. A host-published port, if you add one, is for clients outside the Compose network and is not required for the app. Using the host’s IP, 127.0.0.1 or localhost in UPTIME_KUMA_DB_HOSTNAME points to the wrong network location.
Access denied errors
Confirm that the content of secrets/db_password is the same value supplied to both UPTIME_KUMA_DB_PASSWORD_FILE and MYSQL_PASSWORD_FILE. Check for an accidental extra space or a different newline-handling method. If the volume was initialized previously, remember that editing the file does not change the already-created MariaDB account; update that account deliberately or restore a known-good volume.
The app appears empty after recreation
Verify that the container still mounts the named volume at exactly /app/data and that the database service mounts mariadb_data at /var/lib/mysql. Running a different Compose project name can create new volumes with similar-looking service definitions, so inspect the volumes attached to the running containers before assuming data was deleted.
Security and maintenance practices
- Prefer secrets or file variables for credentials. Compose’s
environmentandenv_filefeatures are convenient for non-secret configuration, but plain-text passwords in YAML or a broadly readable environment file can leak through source control and diagnostics. - Protect the secret directory. Restrict permissions, exclude it from backups that are shared casually, and rotate credentials through a planned database-account change rather than editing files and assuming initialization will rerun.
- Keep MariaDB private. Publish only Uptime Kuma’s web port unless there is a specific administrative requirement for external database access.
- Review image tags. The example’s
:2and:11.7tags are deployment choices, not a guarantee that every future build is appropriate. Read release notes, back up both volumes and test an upgrade before changing tags in production. - Plan storage and recovery. Monitor free space, retain more than one backup generation and perform a restoration drill. Persistent volumes survive container replacement, but they are not a backup by themselves.
SQLite or MariaDB?
Uptime Kuma officially supports both SQLite and MariaDB. The choice is operational rather than a published speed ranking; the reviewed documentation does not provide a benchmark comparing them.
| Decision factor | SQLite | MariaDB |
|---|---|---|
| Operational complexity | One application service and one data file or directory. | Requires a second database service, credentials and database backups. |
| Concurrency behavior | Suitable for simpler deployments, but file locking and concurrent writes depend on the filesystem. | Uses a server database designed for concurrent client connections. |
| Backup and restore | Protect the Uptime Kuma data path and ensure the copy is consistent. | Protect both the SQL database and /app/data; a logical dump can simplify migration. |
| Filesystem requirements | Needs working POSIX file locks. Network filesystems such as NFS can cause problems. | MariaDB files live in the database container’s data volume, but that volume still needs reliable storage and backups. |
| When a separate service is acceptable | Best when minimizing moving parts is more important than a standalone database. | Useful when you already operate MariaDB, need server-style database management or want to separate application and database lifecycles. |
Choosing MariaDB does not eliminate persistence requirements: the database volume remains essential. Conversely, if you stay with SQLite, place /app/data on a local Docker volume or another filesystem with reliable POSIX locking rather than an NFS share that cannot provide the required semantics.
Quick Recap
Upgrade and recovery checklist
- Confirm that both named volumes are included in a recent, restorable backup.
- Record the current image tags and save a copy of the working Compose file and secret-handling procedure.
- Review the release notes for both images and test the new tags in a separate project when possible.
- Stop or recreate services through Compose so volume mounts and environment values remain explicit; do not delete volumes as part of a routine image upgrade.
- After startup, verify MariaDB readiness, sign in to Uptime Kuma, inspect several monitors and confirm that historical data is present.
- If the upgrade fails, preserve the logs, stop further changes and restore the tested volume backup rather than repeatedly reinitializing the database.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




