├── .gitignore ├── _Footer.md ├── Badge.md ├── img ├── docker-host.png └── Synology-reverse-proxy.png ├── Setup-Development-Environment.md ├── Maintenance.md ├── Reset-Password-via-CLI.md ├── .htaccess ├── Notification-Methods.md ├── Cloudflare-Side-Note.md ├── Troubleshooting.md ├── _Menu.md ├── Test-Pull-Requests.md ├── Development-Side-Notes.md ├── 3rd-Party-Addons-Apps.md ├── Systemd-Unit-File.md ├── LICENSE ├── 🆙-How-to-Update.md ├── Status-Page.md ├── index.html ├── OpenRC-Script.md ├── Prometheus-Integration.md ├── Home.md ├── API-Keys.md ├── How-to-Monitor-Docker-Containers.md ├── _Sidebar.md ├── Environment-Variables.md ├── Reverse-Proxy-with-Cloudflare-Tunnel.md ├── 🔧-How-to-Install.md └── Reverse-Proxy.md /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | -------------------------------------------------------------------------------- /_Footer.md: -------------------------------------------------------------------------------- 1 | [Edit this page](https://github.com/louislam/uptime-kuma-wiki) -------------------------------------------------------------------------------- /Badge.md: -------------------------------------------------------------------------------- 1 | (Version >= 1.16.0) 2 | 3 | Please read: https://github.com/louislam/uptime-kuma/pull/1119 -------------------------------------------------------------------------------- /img/docker-host.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RaymiiOrg/uptime-kuma-wiki/master/img/docker-host.png -------------------------------------------------------------------------------- /Setup-Development-Environment.md: -------------------------------------------------------------------------------- 1 | Move to https://github.com/louislam/uptime-kuma/blob/master/CONTRIBUTING.md -------------------------------------------------------------------------------- /img/Synology-reverse-proxy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RaymiiOrg/uptime-kuma-wiki/master/img/Synology-reverse-proxy.png -------------------------------------------------------------------------------- /Maintenance.md: -------------------------------------------------------------------------------- 1 | (Version >= 1.19.0) 2 | 3 | This feature is designed for: 4 | 5 | - Temporary disable notifications during a time window 6 | - Show a maintenance message on status pages. 7 | -------------------------------------------------------------------------------- /Reset-Password-via-CLI.md: -------------------------------------------------------------------------------- 1 | ## With Docker 2 | 3 | ``` 4 | docker exec -it bash 5 | npm run reset-password 6 | ``` 7 | 8 | ## Without Docker 9 | 10 | cd to the working directory. 11 | 12 | ```bash 13 | npm run reset-password 14 | ``` -------------------------------------------------------------------------------- /.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | RewriteEngine On 4 | 5 | RewriteRule ^README.md$ Home.md [L] 6 | 7 | RewriteCond %{REQUEST_FILENAME} !-f 8 | RewriteRule ^ index.html [QSA,L] 9 | 10 | 11 | 12 | 13 | Header set Cache-Control "max-age=86400, public" 14 | 15 | -------------------------------------------------------------------------------- /Notification-Methods.md: -------------------------------------------------------------------------------- 1 | Uptime Kuma supports a lot of notifications. 2 | 3 | For native support platforms, please read here: 4 | 5 | [https://github.com/louislam/uptime-kuma/tree/master/server/notification-providers](https://github.com/louislam/uptime-kuma/tree/master/server/notification-providers) 6 | 7 | Uptime Kuma is integrated Apprise which supports up to 78+ notification services. You can read the full list here: 8 | 9 | https://github.com/caronc/apprise/wiki -------------------------------------------------------------------------------- /Cloudflare-Side-Note.md: -------------------------------------------------------------------------------- 1 | ## Monitoring a website using Cloudflare 2 | 3 | By default, Cloudflare is not API friendly including Uptime Kuma. Cloudflare may block requests from Uptime Kuma. 4 | 5 | You need to disable "Browser Integrity Check" in Cloudflare Dashboard. 6 | 7 | Related discussion: https://community.cloudflare.com/t/api-403-after-enabling-cloudflare/108078/6 8 | 9 | 10 | ## How to proxy Uptime Kuma via Cloudflare 11 | 12 | Please read: 13 | https://github.com/louislam/uptime-kuma/wiki/Reverse-Proxy#cloudflare 14 | -------------------------------------------------------------------------------- /Troubleshooting.md: -------------------------------------------------------------------------------- 1 | 2 | ## Uptime Kuma reports DOWN, but I can access. 3 | 4 | If your Uptime Kuma reports DOWN of your service, sometimes you would like to know it is a bug of Uptime Kuma or your own Docker network issue. 5 | 6 | Go into your container's bash. 7 | 8 | ```bash 9 | docker exec -it uptime-kuma bash 10 | ``` 11 | 12 | Install `curl` 13 | 14 | ```bash 15 | apt update && apt --yes install curl 16 | ``` 17 | 18 | Then you can test with these commands for example: 19 | ```bash 20 | curl https://google.com 21 | ping google.com 22 | ``` 23 | -------------------------------------------------------------------------------- /_Menu.md: -------------------------------------------------------------------------------- 1 | 2 | * **Introduction** 3 | * [Home](README.md) 4 | * [How to Install](🔧-How-to-Install.md) 5 | * [How to Update](🆙-How-to-Update.md) 6 | * [Notification Methods](Notification-Methods.md) 7 | 8 | * **Advanced** 9 | * [Reverse Proxy](Reverse-Proxy.md) 10 | * [Environment Variables](Environment-Variables.md) 11 | * [Cloudflare Side Note](Cloudflare-Side-Note.md) 12 | * [Prometheus Integration](Prometheus-Integration.md) 13 | 14 | * **Tools** 15 | * [Reset Password via CLI](Reset-Password-via-CLI.md) 16 | 17 | -------------------------------------------------------------------------------- /Test-Pull-Requests.md: -------------------------------------------------------------------------------- 1 | Now you can test pull requests without setting up any development environment. 2 | 3 | You just need to use this docker image with specified pr repo name: 4 | ```bash 5 | docker run --rm -it -p 3000:3000 -p 3001:3001 --pull always -e 'UPTIME_KUMA_GH_REPO=' louislam/uptime-kuma:pr-test 6 | ``` 7 | 8 | Example: 9 | UPTIME_KUMA_GH_REPO=`tamasmagyar:test/add-cypress-tests` 10 | 11 | You can copy the name from here easily: 12 | 13 | 14 | 15 | 16 | 17 | Add `-v uptime-kuma-pr-test:/app/data` if you need a persistent storage. 18 | 19 | 20 | After started, go to http://localhost:3000 -------------------------------------------------------------------------------- /Development-Side-Notes.md: -------------------------------------------------------------------------------- 1 | Just a note for some traps and useful things for development. 2 | 3 | - node-bullseye image is not working on Raspberry Pi (armv7), need to downgrade to node-buster. 4 | - node-alpine3.13 image is not working on Raspberry Pi (armv7), need to downgrade to alpine 3.12. 5 | - docker-alpine's dns is actually not stable in some systems. 6 | - [CSS] do not use any system-ui fonts, the fonts will be difference in difference Windows Languages 7 | - [Unit Test] Vue suggested Jest, but what, you cannot run the test in a browser, it is so stupid because all browser functions cannot be tested (localStorage, DOM and more). 8 | - Need to use `jsesc` to escape the content inside . 9 | - .NET 4.7 is the best lowest version to support high DPI monitors -------------------------------------------------------------------------------- /3rd-Party-Addons-Apps.md: -------------------------------------------------------------------------------- 1 | A list of 3rd party addons or applications, plugins or related side projects. 2 | 3 | Feel free to add your project here by making a pull request in this wiki repo: https://github.com/louislam/uptime-kuma-wiki 4 | 5 | - [Streamdeck Uptime Kuma](https://github.com/MarlBurroW/Streamdeck-Uptime-Kuma) - An Uptime Kuma plugin for Elgato Streamdeck 6 | - [xBarApp Uptime Kuma](https://github.com/mariogarridopt/xBar-Uptime-Kuma) - An Uptime Kuma plugin for xBarApp for Mac 7 | - [Uptime Kuma Manager](https://apps.apple.com/us/app/uptime-kuma-manager/id6446004887) - An iOS app that allows you to connect to your Uptime Kuma servers and monitor the services directly from your phone. 8 | - [uptime-kuma-api (Python)](https://github.com/lucasheld/uptime-kuma-api) - A wrapper for the Uptime Kuma Socket.IO API 9 | -------------------------------------------------------------------------------- /Systemd-Unit-File.md: -------------------------------------------------------------------------------- 1 | Aside from the provided pm2 instructions. You can also use systemd to enable and run Uptime-Kuma at system startup more easily. 2 | 3 | ```ini 4 | [Unit] 5 | Description=Uptime-Kuma - A free and open source uptime monitoring solution 6 | Documentation=https://github.com/louislam/uptime-kuma 7 | After=network.target 8 | 9 | [Service] 10 | Type=simple 11 | User=uptime 12 | WorkingDirectory=/home/uptime/uptime-kuma 13 | ExecStart=/usr/bin/npm run start-server 14 | Restart=on-failure 15 | 16 | [Install] 17 | WantedBy=multi-user.target 18 | ``` 19 | 20 | Note: This unit file assumes that you are running the software as a separate 'uptime' user. If you have node/npm installed in a different path, you will need to alter the ExecStart line to match this. 21 | 22 | This unit file may be installed to /etc/systemd/system/uptime-kuma.service (Or whatever service name you'd prefer) 23 | 24 | Once installed, issue the following commands to reload systemd unit files, enable it to start on boot, and start it immediately: 25 | 26 | ```sh 27 | systemctl daemon-reload 28 | systemctl enable --now uptime-kuma 29 | ``` -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Louis Lam 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /🆙-How-to-Update.md: -------------------------------------------------------------------------------- 1 | ## 🆙🐳 Docker 2 | 3 | Re-pull the latest docker image and create another container with the same volume. 4 | 5 | For someone who used my "How-to-use" commands to install Uptime Kuma, you can update by this: 6 | 7 | ```bash 8 | docker pull louislam/uptime-kuma:1 9 | docker stop uptime-kuma 10 | docker rm uptime-kuma 11 | 12 | # Default 13 | docker run -d --restart=always -p 3001:3001 -v uptime-kuma:/app/data --name uptime-kuma louislam/uptime-kuma:1 14 | 15 | # If you are not using default value 16 | # docker run -d --restart=always -p :3001 -v :/app/data --name uptime-kuma louislam/uptime-kuma:1 17 | ``` 18 | 19 | PS: For every new release, it takes some time to build the docker image, please be patient if it is not available yet. 20 | 21 | ## Docker-Compose 22 | 23 | ```bash 24 | cd "" 25 | docker pull louislam/uptime-kuma:1 26 | docker stop uptime-kuma 27 | docker-compose up -d --force-recreate 28 | ``` 29 | 30 | ## 🆙 💪🏻 Non-Docker 31 | 32 | ```bash 33 | cd 34 | 35 | # Update from git 36 | git fetch --all 37 | git checkout 1.21.3 --force 38 | 39 | # Install dependencies and prebuilt 40 | npm install --production 41 | npm run download-dist 42 | 43 | # Restart 44 | pm2 restart uptime-kuma 45 | ``` 46 | -------------------------------------------------------------------------------- /Status-Page.md: -------------------------------------------------------------------------------- 1 | 2 | ## Things You Should Know 3 | 4 | - Status page is intended for public users to check the status of your services 5 | - Status page will caches result for 5 minutes 6 | - Status page is just like a traditional web page. Updates won't be as responsive as the dashboard. 7 | - Status page will refresh the page every 5 minutes 8 | - `default` is a special slug 9 | - `http://example.com/status` is pointing to `http://example.com/status/default` 10 | 11 | ## Multiple Status Pages 12 | (Version >= 1.13.0) 13 | 14 | ## Domain Names for Status Pages 15 | (Version >= 1.14.0) 16 | 17 | Now you can show different status pages based on the domain names. 18 | 19 | 20 | 21 | ### Steps 22 | 23 | 1. If you are not using a reverse proxy, you should expose your Uptime Kuma in port 80. 24 | 2. If you are using a reverse proxy, add your domain name in your reverse proxy and point to Uptime Kuma. 25 | 26 | (⚠️ PS: For such as Apache or nginx, you need to forward the header `X-Forward-Host` or `Host` to Uptime Kuma, otherwise Uptime Kuma do not know the current domain name) 27 | 28 | 3. Add a A/CNAME record for your domain name in your DNS management. 29 | 4. Add your domain name in your status page settings sidebar. 30 | 31 | This is my example, they both are from the same instance: 32 | - https://status.louislam.net 33 | - https://status.kuma.pet 34 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Uptime Kuma Docs 6 | 7 | 8 | 9 | 10 | 11 | 18 | 19 | 20 |
21 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /OpenRC-Script.md: -------------------------------------------------------------------------------- 1 | For Alpine/postmarketOS/Gentoo/Artix, you can create an OpenRC service as 2 | `/etc/init.d/uptime-kuma`: 3 | 4 | ```sh 5 | #!/sbin/openrc-run 6 | 7 | description="Uptime Kuma self-hosted monitoring tool" 8 | 9 | # Change $directory to path to uptime-kuma 10 | directory=${directory:-/usr/share/uptime-kuma} 11 | pidfile=${pidfile:-/run/$RC_SVCNAME.pid} 12 | 13 | log_dir="/var/log/$RC_SVCNAME" 14 | logfile=${logfile:-$log_dir/$RC_SVCNAME.log} 15 | output_log="${output_log:-$logfile}" 16 | error_log="${error_log:-$logfile}" 17 | 18 | command=${command:-/usr/bin/node} 19 | command_args="$directory/server/server.js" 20 | command_user=${command_user:-uptime-kuma:uptime-kuma} 21 | command_background=true 22 | 23 | depend() { 24 | need net 25 | } 26 | 27 | start_pre() { 28 | checkpath --owner=$command_user --directory $log_dir \ 29 | $directory/data \ 30 | $directory/data/upload 31 | checkpath --owner=$command_user --file $logfile \ 32 | $directory/data/error.log 33 | 34 | [ ! -e $directory/data/kuma.db ] && 35 | cp $directory/db/kuma.db $directory/data/ 36 | 37 | checkpath --owner=$command_user --mode 600 --file $directory/data/kuma.db* 38 | } 39 | 40 | start_post() { 41 | # Wait for the server to be started 42 | sleep 10 43 | } 44 | ``` 45 | 46 | Set the script to executable. 47 | 48 | ```sh 49 | sudo chmod 755 /etc/init.d/uptime-kuma 50 | ``` 51 | 52 | Create a user and group `uptime-kuma:uptime-kuma` for the service. 53 | 54 | ```sh 55 | sudo addgroup -S uptime-kuma 56 | sudo adduser -S -D -h /var/lib/uptime-kuma -s /sbin/nologin -G uptime-kuma -g uptime-kuma uptime-kuma 57 | ``` 58 | 59 | Start the service and add it to default runlevel if preferred. 60 | 61 | ```sh 62 | sudo rc-service uptime-kuma start 63 | sudo rc-update add uptime-kuma 64 | ``` 65 | -------------------------------------------------------------------------------- /Prometheus-Integration.md: -------------------------------------------------------------------------------- 1 | # Passing metrics to other platforms 2 | 3 | If you already use [Prometheus.io](https://prometheus.io) or a platform that supports Prometheus exporter format, you can get the metrics about each monitoring target from `http://:/metrics`. 4 | 5 | Labels to filter by include: 6 | 7 | | Label Name | Description | 8 | |------------|-------------| 9 | |monitor_name| The "Friendly Name" of the monitor | 10 | |monitor_type| The type (HTTP, keyword, TCP) of monitoring check | 11 | |monitor_url | The URL to be monitored (HTTP, keyword) 12 | |monitor_hostname | The Hostname to be monitored (TCP) | 13 | |monitor_port | The port to be monitored (TCP) | 14 | 15 | # Prometheus Configuration 16 | 17 | Put the following into your Prometheus config: 18 | 19 | ``` 20 | - job_name: 'uptime' 21 | scrape_interval: 30s 22 | scheme: http 23 | metrics_path: '/metrics' 24 | static_configs: 25 | - targets: ['uptime-kuma.url'] 26 | basic_auth: # Only needed if authentication is enabled (default) 27 | username: 28 | password: 29 | ``` 30 | 31 | You should see the `monitor_response_time` and `monitor_status` metrics showing up in Prometheus 32 | 33 | There is also a [Grafana Dashboard](https://grafana.com/grafana/dashboards/14847) available to import into your Grafana installation to get the metrics integrated with your other monitoring tools. 34 | 35 | # Example PromQL queries 36 | 37 | Assuming we have HTTP monitors in place for bbc.co.uk and google.com: 38 | 39 | ``` 40 | # Show all response rates gouped by site 41 | sum(monitor_response_time) by (monitor_name) 42 | # Show only the response time for BBC.co.uk 43 | sum(monitor_reponse_time{monitor_url="https://www.bbc.co.uk/"}) 44 | # Show the current status of Google.com 45 | monitor_status{monitor_name="Google"} 46 | ``` 47 | -------------------------------------------------------------------------------- /Home.md: -------------------------------------------------------------------------------- 1 | Welcome to the Uptime Kuma wiki! 2 | 3 | ## 🐻? 4 | 5 | Kuma (クマ/熊) means bear 🐻 in Japanese. 6 | 7 | A little bear is watching your website.🐻🐻🐻 8 | 9 | ### Pronunciation 10 | 11 | http://ipa-reader.xyz/?text=%CB%88%CA%8Cpta%C9%AAm%20k%C9%AF%CC%9F%E1%B5%9Dma%CC%A0&voice=Joey 12 | 13 | 14 | ## How to contribute to this wiki? 15 | 16 | You could make a pull request in this wiki repo: 17 | https://github.com/louislam/uptime-kuma-wiki 18 | 19 | ## History 20 | 21 | * (2021-08-21) Reach 1001 Stargazers, thanks everyone! 22 | * (2021-08-26) Reach 2066 Stargazers. Grow so fast! That is unexpected! 23 | * (2021-08-31) Reach 2651 Stargazers. Amazing! 24 | * (2021-09-06) Reach 3066 Stargazers. 👀👏 25 | * (2021-09-12) Docker Pull is over 1M! 26 | * (2021-09-17) 🐣 27 | 28 | 29 | 30 | * (2021-09-29) Reach 3645 Stargazers. 👍 31 | * (2021-09-30) Docker Pull is over 2M! Crazy🤪 32 | * (2021-10-07) Reach 4212 🔭✨⭐. 33 | * (2021-10-08) Reach 4764 Stargazers. One of trending projects of the day! 34 | * (2021-10-11) Reach 6658 Stargazers. Is it a rocket🚀? 35 | * (2021-10-13) Docker Pull is over 3M! 36 | * (2021-10-21) Docker Pull is over 4M! ⭐ It's over 8000! https://www.youtube.com/watch?v=TSQqUfeyHF8 37 | 38 | 39 | 40 | * (2021-10-27) Docker Pull is over 5M! 41 | * (2021-11-08) Docker Pull is over 6.7M! 9242 Stargazers! 42 | * (2021-11-18) Docker Pull is over 8M! 43 | * (2021-12-01) Docker Pull is over 10M! 44 | * (2021-12-02) Reach 10,076 Stargazers! 45 | * (2022-01-21) Reach 12,059 Stargazers! 46 | * (2022-03-02) Docker Pull is over 25M! 14,050 Stargazers! 47 | * (2022-04-10) 15,629 Stargazers! 48 | * (2022-10-09) 21,975 Stargazers! Over 20K! Another Milestone!🐻👍 49 | * (2023-01-09) {"⭐": 27783, "🐳": 31688853 } 50 | * (2023-02-06) let starCount = 29141; let dockerPullCount = 32185677; 51 | * (2023-02-26) `
30,063
32,606,170
` -------------------------------------------------------------------------------- /API-Keys.md: -------------------------------------------------------------------------------- 1 | # API Keys 2 | (Version >= 1.21.0) 3 | 4 | API keys can be used to access secured HTTP APIs, including the 5 | Prometheus metrics endpoint. 6 | 7 | ## Adding an API key 8 | 9 | Management of API keys is done through the API Keys page in settings 10 | This page will show you all of your API keys, including expired keys. 11 | 12 | You can set the name of the key, as well as it's expiry date, or 13 | optionally set the key to never expire. When you click generate, you 14 | will be shown the API key in a pop up dialog, you should make sure to 15 | make a copy of the key as it will not be shown again. The API key cannot 16 | be used to access the web interface but you should treat API keys like 17 | you treat your passwords as they can still be used to access potentially 18 | sensitive data. 19 | 20 | Note: whilst basic authentication will continue to work after you 21 | update, you will be unable to use basic authentication as soon as you 22 | add your first API key. After you have added your first API key, basic 23 | authentication for endpoints will be permanently disabled. 24 | 25 | ## Disabling keys 26 | 27 | It is possible to temporarily disable keys. This can be done through the 28 | settings page. This will prevent the key from being used for 29 | authentication until it is enabled again. 30 | 31 | ## Expired keys 32 | 33 | If a key has expired, it will not be automatically deleted. This is to 34 | aid in debugging systems that suddenly stop working. You can delete an 35 | expired key, or any key for that matter, by simply hitting the red 36 | delete button from the settings page. 37 | 38 | ## Authenticating using an API key 39 | 40 | Authentication is done by passing the API key in the `Authorization` 41 | header. For example, here is a request made with curl to the `metrics` 42 | endpoint. 43 | 44 | ``` 45 | curl -u":" uptime.kuma/metrics 46 | ``` 47 | 48 | Note, the `:` is required before the key as basic authentication 49 | requires a username and password separated by a `:`, however we don't 50 | make use of the username field. 51 | 52 | Here is an example config for Prometheus: 53 | 54 | ``` 55 | - job_name: 'uptime' 56 | scrape_interval: 30s 57 | scheme: http 58 | static_configs: 59 | - targets: ['uptime.url'] 60 | basic_auth: 61 | password: 62 | ``` 63 | 64 | Note: we don't need to set a username field as it is not used. 65 | -------------------------------------------------------------------------------- /How-to-Monitor-Docker-Containers.md: -------------------------------------------------------------------------------- 1 | (Version >= 1.18.0) 2 | 3 | ## If you are running Uptime Kuma Docker 4 | 5 | By default, a docker container is self-contained, which means Uptime Kuma cannot access your host. You need to bind the /var/run/docker.sock to your container. 6 | 7 | ### (Method 1) Share docker.sock with Uptime Kuma Container 8 | 9 | Command argument: 10 | ```bash 11 | -v /var/run/docker.sock:/var/run/docker.sock 12 | ``` 13 | 14 | docker-compose: 15 | 16 | ```yml 17 | volumes: 18 | - /var/run/docker.sock:/var/run/docker.sock 19 | ``` 20 | 21 | ### (Method 2) TCP - Bridge Mode 22 | 23 | **Expose TCP port** 24 | To enable TCP monitoring, you need to first expose the Docker daemon on a TCP port. The primary documentation is available [here](https://docs.docker.com/config/daemon/) but the example below provides some quick options. 25 | 26 | Update the daemon configuration located at `/etc/docker/daemon.json`: 27 | ```json 28 | { 29 | #any additional parameters should be kept 30 | 31 | #Insecure option, only use this if you are running on a closed network 32 | "hosts": ["unix:///var/run/docker.sock", "tcp://:2375"] 33 | 34 | #Secure option 35 | "tls": true, 36 | "tlscert": "/var/docker/server.pem", 37 | "tlskey": "/var/docker/serverkey.pem", 38 | "hosts": ["unix:///var/run/docker.sock", "tcp://:2376"] 39 | } 40 | ``` 41 | 42 | Restart the daemon using `sudo systemctl restart docker.service`. 43 | 44 | If the daemon fails to start, it may be because there are duplicate keys, in this case hosts, -H, that is already part of the daemon configuration. 45 | 46 | You can edit the startup configuration using `sudo systemctl edit docker.service`. 47 | 48 | ```toml 49 | [Service] 50 | #The blank ExecStart is required to clear the current entry point 51 | ExecStart= 52 | #Replace the existing ExecStart but only remove the properties that you have added into the daemon.json file, leave all else the same. 53 | ExecStart=/usr/bin/dockerd --containerd=/run/containerd/containerd.sock 54 | ``` 55 | 56 | My original ExecStart was: `ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock`, note the -H that would cause a duplicate property error. 57 | 58 | **Update uptime-kuma** 59 | Add a new Docker host and choose TCP as the option. Specify the IP address of the host and the TCP port you exposed, as seen below. 60 | 61 | ![Docker host monitor](img/docker-host.png) 62 | 63 | ## Related Disscussion 64 | 65 | - https://github.com/louislam/uptime-kuma/issues/2061 66 | -------------------------------------------------------------------------------- /_Sidebar.md: -------------------------------------------------------------------------------- 1 | - [Home](https://github.com/louislam/uptime-kuma/wiki) 2 | - [Troubleshooting](https://github.com/louislam/uptime-kuma/wiki/Troubleshooting) 3 | 4 | ## Installation & Configuration 5 | - [🔧 How to Install](https://github.com/louislam/uptime-kuma/wiki/%F0%9F%94%A7-How-to-Install) 6 | - [🆙 How to Update](https://github.com/louislam/uptime-kuma/wiki/%F0%9F%86%99-How-to-Update) 7 | - [Environment Variables](https://github.com/louislam/uptime-kuma/wiki/Environment-Variables) 8 | 9 | ## Features 10 | - [Reset Password via CLI](https://github.com/louislam/uptime-kuma/wiki/Reset-Password-via-CLI) 11 | - [Status Page](https://github.com/louislam/uptime-kuma/wiki/Status-Page) 12 | - [Notification Methods](https://github.com/louislam/uptime-kuma/wiki/Notification-Methods) 13 | - [Badge](https://github.com/louislam/uptime-kuma/wiki/Badge) 14 | - [How to Monitor Docker Containers](https://github.com/louislam/uptime-kuma/wiki/How-to-Monitor-Docker-Containers) 15 | - [Maintenance](https://github.com/louislam/uptime-kuma/wiki/Maintenance) 16 | - [3rd Party Addons/Apps](https://github.com/louislam/uptime-kuma/wiki/3rd-Party-Addons-Apps) 17 | - [API Keys](https://github.com/louislam/uptime-kuma/wiki/API-Keys) 18 | 19 | ## Network 20 | - [Reverse Proxy](https://github.com/louislam/uptime-kuma/wiki/Reverse-Proxy) 21 | - [Reverse Proxy with Cloudflare Tunnel](https://github.com/louislam/uptime-kuma/wiki/Reverse-Proxy-with-Cloudflare-Tunnel) 22 | - [Cloudflare Side Note](https://github.com/louislam/uptime-kuma/wiki/Cloudflare-Side-Note) 23 | 24 | ## Integrations 25 | - [Prometheus Integration](https://github.com/louislam/uptime-kuma/wiki/Prometheus-Integration) 26 | - [Systemd Unit File](https://github.com/louislam/uptime-kuma/wiki/Systemd-Unit-File) 27 | - [OpenRC Script](https://github.com/louislam/uptime-kuma/wiki/OpenRC-Script) 28 | 29 | ## Development & Contributions 30 | - [CONTRIBUTING Rules & Guide](https://github.com/louislam/uptime-kuma/blob/master/CONTRIBUTING.md) 31 | - [How to Translate](https://github.com/louislam/uptime-kuma/tree/master/src/lang#how-to-translate) 32 | - [Setup Development Environment](https://github.com/louislam/uptime-kuma/wiki/Setup-Development-Environment) 33 | - [Test Pull Requests](https://github.com/louislam/uptime-kuma/wiki/Test-Pull-Requests) 34 | - [Development Side Notes](https://github.com/louislam/uptime-kuma/wiki/Development-Side-Notes) 35 | 36 | ## More 37 | - [Supported Versions](https://github.com/louislam/uptime-kuma/blob/master/SECURITY.md) 38 | - [MIT License](https://github.com/louislam/uptime-kuma/blob/master/LICENSE) 39 | - [Videos By Youtubers](https://www.youtube.com/playlist?list=PLjfSRxTTcLFm0mAw3fKNZzieXixScm9th) 40 | -------------------------------------------------------------------------------- /Environment-Variables.md: -------------------------------------------------------------------------------- 1 | (1.20.0) For non-Docker users, you can create a new file named `.env` in the root directory. The format is like this: 2 | 3 | ```.env 4 | UPTIME_KUMA_HOST=127.0.0.1 5 | UPTIME_KUMA_PORT=8080 6 | ``` 7 | 8 | Server Argument Usage: 9 | ```bash 10 | node server/server.js --host=127.0.0.1 --port=8080 11 | ``` 12 | 13 | ## Server Environment Variables 14 | 15 | | Environment Variable | Server Argument | Description | Default | 16 | | ------------------------------------------ | -------------------------- | --------------------------------------------------------------------- | ---------: | 17 | | `DATA_DIR` | `--data-dir=` | Set the directory where the data should be stored (could be relative) | `./data/` | 18 | | `UPTIME_KUMA_HOST` or `HOST` | `--host=` | Host to bind to, could be an ip. | `::` | 19 | | `UPTIME_KUMA_PORT` or `PORT` | `--port=` | Port to listen to | `3001` | 20 | | `UPTIME_KUMA_SSL_KEY` or `SSL_KEY` | `--ssl-key=` | Path to SSL key | | 21 | | `UPTIME_KUMA_SSL_CERT` or `SSL_CERT` | `--ssl-cert=` | Path to SSL certificate | | 22 | | `UPTIME_KUMA_SSL_KEY_PASSPHRASE` or `SSL_KEY_PASSPHRASE` | `--ssl-key-passphrase=` | (1.21.1) SSL Key Passphrase | | 23 | | `UPTIME_KUMA_CLOUDFLARED_TOKEN` | `--cloudflared-token=` | (1.14.0) Cloudflare Tunnel Token | | 24 | | `UPTIME_KUMA_DISABLE_FRAME_SAMEORIGIN` | `--disable-frame-sameorigin=` | By default, Uptime Kuma is not allowed in iframe if the domain name is not the same as the parent. It protects your Uptime Kuma to be a phishing website. If you don't need this protection, you can set it to `true` | `false` | 25 | | `NODE_EXTRA_CA_CERTS` | | Add your self-signed ca certs. (e.g. /cert/path/CAcert.pem) [Read more](https://github.com/louislam/uptime-kuma/issues/1380) | | 26 | | `NODE_TLS_REJECT_UNAUTHORIZED` | | Ignore all TLS errors | `0` | 27 | | `NODE_OPTIONS` | | Set it to `--insecure-http-parser`, if you encountered error `Invalid header value char` when your website using WAF | | 28 | 29 | 30 | ## Docker Specific Environment Variables 31 | 32 | | Environment Variable | Description | Default | 33 | | -------------------- | ----------------------------------- | ------: | 34 | | `PUID` | User id to access the data storage | `1000` | 35 | | `PGID` | Group id to access the data storage | `1000` | 36 | 37 | ## For Development only 38 | 39 | | Environment variable | Server argument | Description | Default | 40 | | ------------------------------------------ | -------------------------- | --------------------------------------------------------------------- | ---------: | 41 | | `NODE_ENV` | | Set the NodeJS environment flag. `development`, `production` | production | 42 | | `UPTIME_KUMA_LOG_RESPONSE_BODY_MONITOR_ID` | | Monitor ID - If provided, it will output the monitor's response to your console | | 43 | | `UPTIME_KUMA_HIDE_LOG` | | (1.15.0) Examples: `debug_monitor,info_monitor,debug_cert,warn_monitor` | | 44 | | `SQL_LOG` | | Set `1` to enable | | | 45 | | `UPTIME_KUMA_ENABLE_EMBEDDED_MARIADB`| | (2.0.0) Set `1` to enable | | | 46 | -------------------------------------------------------------------------------- /Reverse-Proxy-with-Cloudflare-Tunnel.md: -------------------------------------------------------------------------------- 1 | ## Description 2 | 3 | This is the easiest reverse proxy that I have ever seen so far! 4 | 5 | Despite a lot of reverse proxy methods in the world, unfortunately, none of them are actually easy-to-use in my opinion. As in the past, many Uptime Kuma users kept asking how to config a reverse proxy. 6 | 7 | Recently, I just discovered that Cloudflare has added a web GUI for Cloudflare Tunnel which make it super easy to use. You can expose your Uptime Kuma to the Internet without so many configs! 8 | 9 | For Docker users, you just need to provide a Cloudflare Tunnel token in the Settings, then you can browse Uptime Kuma on the Internet. 10 | 11 | Read more about cloudflared: 12 | https://www.reddit.com/r/selfhosted/comments/tp0nqg/cloudflare_has_added_a_web_gui_for_controlling/ 13 | 14 | Pros: 15 | - Free of charge 16 | - Full GUI, zero-config files 17 | - You can put your Uptime Kuma behind firewall 18 | - No need to expose your real IP 19 | - Expose Docker port is optional 20 | - No need a reverse proxy software such as Nginx, Caddy or Traefik 21 | - Zero-config SSL 22 | - Free SSL 23 | 24 | Cons: 25 | - (Not a con if you are already using Cloudflare) You domain's nameserver have to move to Cloudflare. 26 | - Added 30MB to the docker base image 27 | 28 | ## Requirements 29 | 30 | - Your domain name's DNS is managed by Cloudflare. 31 | - For Docker, it is supported by Debian base only. The Alpine base is not supported yet. 32 | - For non-Docker, you need to download and install `cloudflared`. https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/install-and-setup/installation/ 33 | - For non-Docker Windows users, you can download the msi installer on their Github release: https://github.com/cloudflare/cloudflared/releases/latest 34 | 35 | ## TL;DR 36 | 37 | 1. Create a tunnel on [Cloudflare Zero Trust](https://dash.teams.cloudflare.com/). 38 | 2. Get your tunnel token and set it into your Uptime Kuma instance. 39 | 3. Map to http://localhost:3001. 40 | 3. Profit. 41 | 42 | ## Step by step 43 | 44 | The steps are actually very simple. However, since the concept is pretty new to anyone, it may be good to write it in detail. 45 | 46 | But trust me, once you learnt, you will remember how to config without this guide again! While for Nginx or Traefik, I never could remember how to config without googling it. 47 | 48 | 49 | 50 | 1. Go to [Cloudflare Zero Trust](https://dash.teams.cloudflare.com/). 51 | 2. `Access` > `Tunnels` > `Create Tunnel` 52 | 53 | 54 | 55 | 3. Type a `Tunnel name` such as `uptime-kuma` and save tunnel. 56 | 4. Click the token to copy it. 57 | 58 | 59 | 60 | 5. Go to your Uptime Kuma instance. 61 | 62 | 63 | 64 | 6. `Settings` > `Reverse Proxy` 65 | 7. Paste the token into the `Cloudflare Tunnel Token` field. 66 | 8. Click `Start cloudflared` 67 | 9. Go back to `Cloudflare Zero Trust`, if you see your connector, then click `Next` 68 | 69 | 70 | 71 | 10. Choose your favorite domain name and map to `http://localhost:3001` 72 | 73 | 74 | 75 | 11. Click `Save` and go to your domain name `https://` and profit! 76 | Yeah, it also automatically gives you SSL! 77 | 78 | 79 | 80 | 81 | ## How to Stop 82 | 83 | - Option 1. You can remove the map on Cloudflare. 84 | - Option 2. You can click `Stop cloudflared` and `Remove Token` in your Uptime Kuma. 85 | 86 | 87 | ## Environment Variable 88 | 89 | Alternatively, you can set the token via a environment variable. cloudflared will be started automatically. 90 | 91 | With this approach, you don't even need to expose your container port to the host machine. 92 | 93 | UPTIME_KUMA_CLOUDFLARED_TOKEN=`` 94 | 95 | -------------------------------------------------------------------------------- /🔧-How-to-Install.md: -------------------------------------------------------------------------------- 1 | - [🚀 Installer](#-installer-via-cli) 2 | - [🐳 Docker](#-docker) 3 | - [💪🏻 Without Docker](#-without-docker-recommended-for-x86x64-only) 4 | - [☁️ Unofficial Install- and Hosting Options](#unofficial--experimental) 5 | 6 | ## 🚀 Installer via CLI 7 | 8 | [Ubuntu/CentOS] Interactive CLI installer, supports Docker or without Docker. 9 | 10 | ```bash 11 | curl -o kuma_install.sh http://git.kuma.pet/install.sh && sudo bash kuma_install.sh 12 | ``` 13 | 14 | ## Advanced Installation 15 | 16 | ### 🐳 Docker 17 | 18 | ```bash 19 | # Create a volume 20 | docker volume create uptime-kuma 21 | 22 | # Start the container 23 | docker run -d --restart=always -p 3001:3001 -v uptime-kuma:/app/data --name uptime-kuma louislam/uptime-kuma:1 24 | ``` 25 | 26 | Browse to http://localhost:3001 after started. 27 | 28 | Change Port and Volume 29 | 30 | ```bash 31 | docker run -d --restart=always -p :3001 -v :/app/data --name uptime-kuma louislam/uptime-kuma:1 32 | ``` 33 | 34 | ⚠️ Please use a **local volume** only. Other types such as NFS are not supported. 35 | 36 | #### Docker Tags Description 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 |
Tag(s)Description
latest, 1, 1.*latest stable - debian
debian, 1-debian, 1.*-debianlatest stable - debian
❌alpine, 1-alpine, 1.*-alpine(❌Deprecated due to DNS issues) latest stable - alpine
nightly*development build, unstable
51 | 52 | ### 🐳 Docker Compose Example 53 | 54 | https://github.com/louislam/uptime-kuma/blob/master/docker/docker-compose.yml 55 | 56 | 57 | ### 💪🏻 Without Docker (Recommended for x86/x64 only) 58 | 59 | It should supports Linux/Windows/MacOS. 60 | 61 | Required Tools: 62 | - [Node.js](https://nodejs.org/en/) >= 14 63 | - [Git](https://git-scm.com/downloads) 64 | - [PM2](https://pm2.keymetrics.io/) 65 | - (Optional) [cloudflared](https://github.com/cloudflare/cloudflared) 66 | - (Optional) [Apprise](https://github.com/caronc/apprise) 67 | 68 | 69 | ```bash 70 | # Update your npm to the latest version 71 | npm install npm -g 72 | 73 | # Clone the repository 74 | # If you don't want to install Uptime Kuma into your homefolder but instead into a more permanent location, follow the "Create app directory in /opt" steps under **Useful Commands** and then continue here. 75 | git clone https://github.com/louislam/uptime-kuma.git 76 | cd uptime-kuma 77 | npm run setup 78 | 79 | # Option 1. Try it 80 | node server/server.js 81 | 82 | # (Recommended) 83 | # Option 2. Run in background using PM2 84 | # Install PM2 if you don't have: npm install pm2 -g 85 | pm2 start server/server.js --name uptime-kuma 86 | 87 | ``` 88 | 89 | Browse to http://localhost:3001 after started. 90 | 91 | ``` 92 | # Listen to different port or hostname 93 | pm2 start server/server.js --name uptime-kuma -- --port=80 --host=0.0.0.0 94 | ``` 95 | 96 | #### Useful Commands 97 | 98 | ```bash 99 | pm2 start uptime-kuma 100 | pm2 stop uptime-kuma 101 | pm2 restart uptime-kuma 102 | 103 | # Run at startup 104 | pm2 startup 105 | 106 | # Create app directory in /opt for home-independent app storage 107 | cd /opt 108 | sudo mkdir uptime-kuma 109 | sudo chown -R {username}:{username} uptime-kuma # Replace {username} with the username you are currently running the commands with 110 | ``` 111 | 112 | ### 🪟 Windows Portable 113 | 114 | ![](https://user-images.githubusercontent.com/1336778/227160967-907ba113-c89d-4ec3-bb94-4c4ea6b7cb6f.png) 115 | 116 | 117 | Requirement: 118 | - Arch: x64 119 | - .NET 4.8 Runtime 120 | - Internet for initialization (Download Node.js runtime and Uptime Kuma source code) 121 | 122 | Download: https://github.com/louislam/uptime-kuma/releases/download/1.21.0/uptime-kuma-win64-portable-1.0.0.zip 123 | 124 | ## (Optional) One more step for Reverse Proxy 125 | 126 | This is optional for someone who want to use a reverse proxy. 127 | 128 | Unlikely other web apps, Uptime Kuma is based on WebSocket. You need two more headers **"Upgrade"** and **"Connection"** in order to reverse proxy WebSocket. 129 | 130 | Please read wiki for more info: 131 | https://github.com/louislam/uptime-kuma/wiki/Reverse-Proxy 132 | 133 | ## Videos 134 | 135 | - [Learn Uptime Kuma in 5 Minutes](https://www.youtube.com/watch?v=muZiPdH2JZ8) by DEVOPS UNLOCKED 136 | Install with the docker run command 137 | - [Meet Uptime Kuma, a Fancy Open Source Uptime Monitor](https://www.youtube.com/watch?v=r_A5NKkAqZM) by Techno Tim 138 | Install with docker-compose 139 | - [Monitor Status with Uptime Kuma - Let's install Uptime Kuma with Docker](https://www.youtube.com/watch?v=rRKvDMGeeBA) by Geeked 140 | Install with Portainer 141 | 142 | 143 | ## Unofficial & Experimental 144 | 145 | ⚠ ⚠ ⚠ Warning: Generally, I only test Docker and Node.js. All installation methods here may be broken in the future release. I don't maintain them. Use at your own risk. 146 | 147 | 148 | ### ☸️ Kubernetes (Unofficial) 149 | 150 | ⚠ Warning: K8s deployment is provided by contributors. I have no experience with K8s and I can't fix error in the future. 151 | 152 | See more [here](https://github.com/louislam/uptime-kuma/tree/k8s-unofficial/kubernetes) 153 | 154 | ### ☸️ OpenShift 4 and Kubernetes Helm 3 Chart (Unofficial) 155 | 156 | > Note: This Chart relies on a repackaged OCI Container Image, which lets *uptime-kuma* run as **non-root** user. \ 157 | > The entire repackage process is automated via GitHub Actions and renovate-bot keeps everything up to date. (feel free to audit it yourself) 158 | 159 | The Containerfile used to rebundle *uptime-kuma*: [rootless Containerfile](https://github.com/k3rnelpan1c-dev/uptime-kuma-helm/blob/main/container/Containerfile) 160 | 161 | https://github.com/k3rnelpan1c-dev/uptime-kuma-helm 162 | 163 | ### Ansible (Unofficial) 164 | 165 | https://github.com/louislam/uptime-kuma/tree/ansible-unofficial/ansible 166 | 167 | ### Home Assistant add-on (Unofficial) 168 | 169 | https://github.com/hassio-addons/addon-uptime-kuma 170 | 171 | [![Open this add-on in your Home Assistant instance.](https://my.home-assistant.io/badges/supervisor_addon.svg)](https://my.home-assistant.io/redirect/supervisor_addon/?addon=a0d7b954_uptime-kuma&repository_url=https%3A%2F%2Fgithub.com%2Fhassio-addons%2Frepository) 172 | 173 | Also check out the corresponding custom integration: https://github.com/meichthys/uptime_kuma (WIP). 174 | 175 | ### Install on Synology NAS (Unofficial) 176 | 177 | Unofficial tutorial by Marius Bogdan Lixandru: 178 | 179 | https://mariushosting.com/how-to-install-uptime-kuma-on-your-synology-nas/ 180 | 181 | ### One-Click Hosting on PikaPods 182 | 183 | Run with one click on [PikaPods.com](https://www.pikapods.com/). Free for about 3 months with welcome credit. 184 | 185 | [![PikaPods](https://www.pikapods.com/static/run-button.svg)](https://www.pikapods.com/pods?run=uptime-kuma) 186 | 187 | ### Termux (Unofficial/Experiment) 188 | 189 | Do you have an old Android phone? You could install Uptime Kuma on it! 190 | 191 | https://github.com/louislam/uptime-kuma/issues/423 192 | 193 | ### Install on Azure Container Instance with TLS endpoint 194 | 195 | Unofficial tutorial by Stefan: 196 | https://haci.io/posts/uptime-kuma-azure-container-instance/ 197 | 198 | ### Install on Azure AppService Container 199 | 200 | Unofficial tutorial by Leandro: 201 | https://www.leandroscardua.com/blog/deploy-uptime-kuma-on-azure/ 202 | 203 | ### Install on Azure AppService with persistent storage 204 | 205 | Unofficial bicep deployment script by Yannick Zwijsen: 206 | https://github.com/yzwijsen/deploy-uptime-kuma-azure 207 | 208 | ### SQLite S3 persistent storage with Litestream.io 209 | [![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/new/template/UfDasl?referralCode=373) 210 | 211 | Run uptime-kuma with S3 persistent sqlite database: 212 | https://github.com/fluential/litestream-uptime-kuma/ 213 | 214 | ### Install on Zeabur 215 | 216 | Run with one click on [Zeabur](https://zeabur.com/). 217 | https://docs.zeabur.com/marketplace/umami -------------------------------------------------------------------------------- /Reverse-Proxy.md: -------------------------------------------------------------------------------- 1 | In order to expose Uptime Kuma to the web securely, it is recommended to proxy it behind a traditional webserver such as nginx or Apache. Below are some example configurations that you could use. 2 | 3 | Unlike other web apps, Uptime Kuma is based on WebSocket. You need two more headers **"Upgrade"** and **"Connection"** in order to accept WebSocket on a reverse proxy. 4 | 5 | Uptime Kuma **does not support a subdirectory** such as `http://example.com/uptimekuma`. Please prepare a domain or sub-domain to do that. 6 | 7 | - [Nginx](#nginx) 8 | - [Apache](#apache) 9 | - [Caddy](#caddy) 10 | - [Caddy with Docker-Compose](#caddy-with-docker-compose) 11 | - [Https-Portal](#https-portal) 12 | - [Nginx Proxy Manager](#nginx-proxy-manager) 13 | - [Synology Builtin Reverse Proxy](#synology-builtin-reverse-proxy) 14 | - [Traefik](#Traefik) 15 | - [Cloudflare](#cloudflare) 16 | - [Cloudflare Tunnels](#cloudflare-tunnels) 17 | - [OpenLiteSpeed](#openlitespeed) 18 | - [HAProxy](#haproxy) 19 | - Others 20 | - [SSL/HTTPS](#sslhttps) 21 | 22 | 23 | # Nginx 24 | 25 | With SSL: 26 | ```nginx 27 | server { 28 | listen 443 ssl http2; 29 | # Remove '#' in the next line to enable IPv6 30 | # listen [::]:443 ssl http2; 31 | server_name sub.domain.com; 32 | ssl_certificate /path/to/ssl/cert/crt; 33 | ssl_certificate_key /path/to/ssl/key/key; 34 | # *See "With SSL (Certbot)" below for details on automating ssl certificates 35 | 36 | location / { 37 | proxy_set_header X-Real-IP $remote_addr; 38 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 39 | proxy_set_header Host $host; 40 | proxy_pass http://localhost:3001/; 41 | proxy_http_version 1.1; 42 | proxy_set_header Upgrade $http_upgrade; 43 | proxy_set_header Connection "upgrade"; 44 | } 45 | } 46 | ``` 47 | 48 | Without SSL: 49 | ```nginx 50 | server { 51 | listen 80; 52 | # Remove '#' in the next line to enable IPv6 53 | # listen [::]:80; 54 | server_name sub.domain.com; 55 | location / { 56 | proxy_pass http://localhost:3001; 57 | proxy_http_version 1.1; 58 | proxy_set_header Upgrade $http_upgrade; 59 | proxy_set_header Connection "upgrade"; 60 | proxy_set_header Host $host; 61 | } 62 | } 63 | ``` 64 | 65 | With SSL (Certbot): 66 | ```nginx 67 | server { 68 | # If you don't have one yet, you can set up a subdomain with your domain registrar (e.g. Namecheap) 69 | # Just create a new host record with type='A Record', host='', value=''. 70 | 71 | server_name your_subdomain.your_domain.your_tld; 72 | 73 | location / { 74 | proxy_set_header X-Real-IP $remote_addr; 75 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 76 | proxy_set_header Host $host; 77 | proxy_pass http://localhost:3001/; 78 | proxy_http_version 1.1; 79 | proxy_set_header Upgrade $http_upgrade; 80 | proxy_set_header Connection "upgrade"; 81 | } 82 | } 83 | 84 | # Once that's completed, you can run 85 | # sudo apt install python3-certbot-nginx 86 | # sudo certbot --nginx -d your_domain -d your_subdomain.your_domain -d www.your_domain 87 | # And Certbot will auto-populate this nginx .conf file for you, while also renewing your certificates automatically in the future. 88 | ``` 89 | 90 | # Apache 91 | With SSL: 92 | ```apache 93 | 94 | ServerName sub.domain.com 95 | SSLEngine On 96 | SSLCertificateFile /path/to/ssl/cert/crt 97 | SSLCertificateKeyFile /path/to/ssl/key/key 98 | # Protocol 'h2' is only supported on Apache 2.4.17 or newer. 99 | Protocols h2 http/1.1 100 | 101 | ProxyPass / http://localhost:3001/ 102 | RewriteEngine on 103 | RewriteCond %{HTTP:Upgrade} =websocket 104 | RewriteRule /(.*) ws://localhost:3001/$1 [P,L] 105 | RewriteCond %{HTTP:Upgrade} !=websocket 106 | RewriteRule /(.*) http://localhost:3001/$1 [P,L] 107 | 108 | ``` 109 | 110 | Without SSL: 111 | ```apache 112 | 113 | ServerName sub.domain.com 114 | 115 | ProxyPass / http://localhost:3001/ 116 | RewriteEngine on 117 | RewriteCond %{HTTP:Upgrade} websocket [NC] 118 | RewriteCond %{HTTP:Connection} upgrade [NC] 119 | RewriteRule ^/?(.*) "ws://localhost:3001/$1" [P,L] 120 | 121 | ``` 122 | 123 | # Caddy 124 | 125 | ```nginx 126 | subdomain.domain.com { 127 | reverse_proxy 127.0.0.1:3001 128 | } 129 | ``` 130 | 131 | # Caddy with Docker-compose 132 | 133 | If you run Uptime Kuma using Docker-Compose and don't already have a reverse proxy, this is a simple way to configure Caddy. You only need to replace 'status.example.org' with your domain. 134 | 135 | ```yml 136 | version: '3' 137 | networks: 138 | default: 139 | name: 'proxy_network' 140 | services: 141 | uptime-kuma: 142 | image: louislam/uptime-kuma:1 143 | restart: unless-stopped 144 | volumes: 145 | - /srv/uptime:/app/data 146 | labels: 147 | caddy: status.example.org 148 | caddy.reverse_proxy: "* {{upstreams 3001}}" 149 | caddy: 150 | image: "lucaslorentz/caddy-docker-proxy:ci-alpine" 151 | ports: 152 | - "80:80" 153 | - "443:443" 154 | volumes: 155 | - /var/run/docker.sock:/var/run/docker.sock:ro 156 | - /srv/caddy/:/data 157 | restart: unless-stopped 158 | environment: 159 | - CADDY_INGRESS_NETWORKS=proxy_network 160 | ``` 161 | 162 | # Https-Portal 163 | 164 | Enabling "WEBSOCKET=true", or the equivalent in your docker environment variables will do the trick. 165 | Link to https-portal Websocket under [Advanced Usage](https://github.com/SteveLTN/https-portal#configure-nginx-through-environment-variables). 166 | 167 | Example docker-compose.yml file using Https-Portal: 168 | 169 | ``` 170 | version: '3.3' 171 | 172 | services: 173 | https-portal: 174 | image: steveltn/https-portal:1 175 | ports: 176 | - '80:80' 177 | - '443:443' 178 | links: 179 | - uptime-kuma 180 | restart: always 181 | environment: 182 | DOMAINS: 'status.domain.com -> http://uptime-kuma:3001' 183 | STAGE: 'production' # Don't use production until staging works 184 | # FORCE_RENEW: 'true' 185 | WEBSOCKET: 'true' 186 | volumes: 187 | - https-portal-data:/var/lib/https-portal 188 | 189 | uptime-kuma: 190 | image: louislam/uptime-kuma:1 191 | container_name: uptime-kuma 192 | volumes: 193 | - ./uptime-kuma:/app/data 194 | ports: 195 | - 3001:3001 196 | 197 | volumes: 198 | https-portal-data: 199 | ``` 200 | Only change "status.domain.com" to your domain 201 | 202 | # Nginx Proxy Manager 203 | 204 | Please enable "WebSockets Supports" 205 | 206 | 207 | # Synology Builtin Reverse Proxy 208 | 209 | 210 | 1. Bind IP to localhost when starting Kuma 211 | 212 | ```bash 213 | docker run -d --restart=always -p 127.0.0.1:3002:3001 -v uptime-kuma:/app/data --name uptime-kuma louislam/uptime-kuma:1 214 | ``` 215 | 216 | 2. On your NAS, open *Control Panel* and then *Login Portal* 217 | 3. Click on *Advanced* 218 | 4. Open *Reverse Proxy* 219 | 5. Create a new Entry with the following values: 220 | 221 | ![Reverse Proxy](./img/Synology-reverse-proxy.png) 222 | 223 | # Traefik 224 | ``` 225 | labels: 226 | - "traefik.enable=true" 227 | - "traefik.http.routers.uptime-kuma.rule=Host(`YourOwnHostname`)" 228 | - "traefik.http.routers.uptime-kuma.entrypoints=https" 229 | - "traefik.http.routers.uptime-kuma.tls=true" 230 | - "traefik.http.routers.uptime-kuma.tls.certresolver=myresolver" 231 | - "traefik.http.services.uptime-kuma.loadBalancer.server.port=3001" 232 | ``` 233 | Add the above to your `docker-compose.yml` file and replace "YourOwnHostname" with the hostname you want to use. When setup correctly, Traefik can automatically get a Let’s Encrypt certificate for your service. 234 | 235 | # Cloudflare 236 | 237 | You must enable "WebSockets" in Cloudflare Dashboard: 238 | 239 | Cloudflare Dashboard -> Network -> Enable WebSockets 240 | 241 | Read more: 242 | https://github.com/louislam/uptime-kuma/issues/138#issuecomment-890485229 243 | 244 | # Cloudflare Tunnels 245 | 246 | It is the easiest way in my opinion. 247 | 248 | Read more: https://github.com/louislam/uptime-kuma/wiki/Reverse-Proxy-with-Cloudflare-Tunnel 249 | 250 | # OpenLiteSpeed 251 | 252 | Create a new virtual host through the graphical admin like you normally would. 253 | 254 | **Basic tab** 255 | - Name: `uptime-kuma` 256 | - Virtual Host Root: `/path/to/uptime-kuma` 257 | - Enable Scripts/ExtApps: `Yes` 258 | 259 | **External app tab** 260 | - Add a `web server` app type 261 | - Name: `uptime-kuma` 262 | - Address: `http://localhost:3001` 263 | 264 | **Context tab** 265 | 266 | - Add a `proxy` context 267 | - URI: `/` 268 | - Web Server: `[VHost Level]: uptime-kuma` 269 | - Header Operations: 270 | ``` 271 | Upgrade websocket 272 | Connection upgrade 273 | ``` 274 | - Access Allowed: `*` 275 | 276 | **Web Socket Proxy tab** 277 | 278 | - Add a `Web Socket Proxy Setup` 279 | - URI: `/` 280 | - Address: `127.0.0.1:3001` 281 | 282 | **SSL tab (if needeed)** 283 | 284 | - Private Key File: `/path/to/ssl/key/privkey.pem` 285 | - Certificate File: `/path/to/ssl/cert/fullchain.pem` 286 | - Chained Certificate: `yes` 287 | 288 | Perform a graceful restart and launch uptime-kuma. 289 | 290 | # HAProxy 291 | 292 | No special configuration is required when using HAProxy as a reverse 293 | proxy although you may wish to add the `timeout tunnel` option to either 294 | the `defaults`, `listen`, or `backend` sections. If using the `timeout 295 | tunnel` option, it is also recommended to set `timeout client-fin` to 296 | handle instances where the client stops responding. 297 | 298 | Read more: 299 | http://cbonte.github.io/haproxy-dconv/2.4/configuration.html#4.2-timeout%20tunnel 300 | 301 | # Others 302 | 303 | ## SSL/HTTPS 304 | 305 | It is recommended to use SSL (HTTPS) with your web-server to avoid MiTM attacks when on a public network. If using caddy these certificates will be auto-generated and updated. 306 | 307 | If using Apache or NGINX, it is recommended to use CertBot to manage SSL for free, it uses Let’s Encrypt to get it’s certificates and keeps them renewed. You can also use your own certificates and place them as shown above. If using CertBot use the "Without SSL" settings and then run certbot on it and it will automatically configure auto-HTTPS redirection. 308 | --------------------------------------------------------------------------------