Install Uptime Kuma using Docker or Docker Compose

Docker and Docker Compose are the most popular methods of installing Uptime Kuma. With Docker, Uptime Kuma runs in a containerized environment. This way you don’t have to worry about any dependencies, everything is in one package. This allows system administrators to easily replicate or redeploy Uptime Kuma within minutes without having to worry about installing any other software and libraries.

Docker Compose saves you from typing multiple commands in order to install and configure Uptime Kuma. It is all done from one single file. This same docker-compose.yml file can be use to make the deployment scaleable and repeatable in different environments. Basic maintenance tasks that are usually painful on traditional installation methods are easier with Docker. For example, to update the Uptime Kuma image, all you have to do is pull the latest image and restart the container that is it!

Requirements

To be able to Install Uptime Kuma using Docker or Docker Compose you need to make sure these are installed prior to you continuing:

If you do not have Docker and Docker Compose already installed, it can be installed with the following commands below:

Install Uptime Kuma with Docker Compose

Once you have installed the above, it is now time to create a directory for Uptime Kuma. You can use the following command to create a directory in “/home”.

Once you have run the above command, it is now time to create a docker-compose.yml file. You can use either Nano or Vim editor, for the purpose of this guide we are using Nano:

You can now copy and paste the following contents of the example docker-compose.yml file we have for Uptime Kuma which is optimized for security and performance (Feel free to make changes as needed):

Now save the file and run the following command to start the Uptime Kuma container:

Now you can go to your browser and visit Uptime Kuma:

Install Uptime Kuma with Docker

If you do not want to use Docker Compose, you can use the following one-liner Docker run command as well to Install Uptime Kuma which is much quicker as no .yml file is required:

Now you can go to your browser and visit Uptime Kuma:

Useful Docker Commands to Manage Uptime Kuma Better

You can use the following command below to check Docker log files for your container:

If you are seeing any issues, you can also try a container restart:

Top restart an Uptime Kuma Docker container, run the following command:

If you would like to stop and remove the container:

To simply stop Uptime Kuma:

If you have any persistent data that you would like to be removed run:

Note: The above Docker Compose YAML file and Docker run command can also be found on the Uptime Kuma download page.