Docker Compose configuration for running poweruptime.
- Clone the docker-compose repository.
git clone https://github.com/poweruptime/docker-compose.git poweruptime && cd ./poweruptime && chmod +x ./pu
- (Optional) Checkout specific version (or just stay on main, which is the latest release)
git checkout X.X.X
git checkout beta
- Setup
You can also start the stack
./pu setup
-
Make sure no other services listen on port
80and443. -
Copy
.env.exmapleto.envcp .env.example .env
-
Fill out the necessary .env variables.
nano .env
vim .env
Generate secrets for
DATABASE_PASSWORDandPOSTGRES_PASSWORDwith theopensslcommand:openssl rand -base64 64 | tr -dc A-Za-z0-9 | head -c 60 ; echo
[!NOTE]
TheDATABASE_PASSWORDis also used for encrypting your database backups. -
Start the stack
./pu start
./pu start./pu stop./pu updateImportant
If an update requires a new PostgreSQL major version, ./pu update aborts without changing anything.
./pu start also refuses to start while the old database volume exists and the new one has not been created yet.
It only checks that the new volume exists, not that the restore succeeded.
Follow Upgrading PostgreSQL instead.
The data of a PostgreSQL database can't be reused by a newer major version (e.g. 17 -> 18). The database has to be backed up with the old version and restored into a new, empty database with the new version. The new version uses a new Docker volume, so the old data stays untouched and you can roll back at any time.
| PostgreSQL | Docker volume |
|---|---|
| 17 | poweruptime-prod_poweruptime-db-data |
| 18 | poweruptime-prod_poweruptime-db-data-18 |
Run all commands in your poweruptime directory. The stack must still be running the old version.
- Stop the backend and web (keeps the database running), so no data changes after the backup.
docker stop poweruptime-web poweruptime-backend
- Back up the database and verify the backup. Note the file name printed by
./pu backup../pu backup ./pu backup-verify backup/poweruptime-db/<timestamp>.sql.gpg
[!TIP] Copy the backup file somewhere off the server as well.
- Stop the stack.
./pu stop
- Check out the new version.
git pull
git fetch --tags && git checkout X.X.X - Start only the database. This creates a new, empty database with the new PostgreSQL version.
docker compose -f _base.yml -f prod.yml --env-file versions.env --env-file .env up -d --wait poweruptime-db
[!WARNING] Don't start the whole stack yet. The backend would create an empty schema and the restore would fail.
- Check that the new version is running.
docker exec poweruptime-db postgres --version - Restore the backup into the new database.
./pu backup-import backup/poweruptime-db/<timestamp>.sql.gpg
[!CAUTION] Only continue once the import prints
Import finished. If it fails, it rolls back completely and the new database stays empty. Fix the cause (or roll back) before starting the stack. - Start the stack.
./pu start
- Check that everything works and your data is there. Once you are sure, you can remove the old volume:
docker volume rm poweruptime-prod_poweruptime-db-data
As long as the old volume exists, you can go back to the previous version. Data written after the upgrade is lost.
./pu stop
git checkout <previous version>
./pu startEnabling OAuth2 lets any user registered with your Identity Provider (IdP) log in (or create an account) on your poweruptime instance.
Accounts are matched by E-Mail address: if an OAuth2 user’s E-Mail matches an existing account, they simply log into that account.
-
User Uniqueness
- Identification is by E-Mail address only.
- No duplicate accounts: the same E-Mail always maps to one user.
-
Feature Parity
Users who sign up or log in via OAuth2 have exactly the same capabilities as those who register via the dashboard:
- Deactivate/reactivate accounts
- Set up MFA
- OAuth2 login skips MFA,
- but MFA still applies when logging in with E-Mail & password
- Reset password
- Change password (the initial password for an user registered/created via OAuth2 user is randomly generated behind the scenes)
- Join teams
- Be granted admin rights
-
Limitations
- With OAuth2 is enabled, users cannot change their E-Mail address (this restriction applies instance-wide to all users).
All other user-management operations work exactly the same, regardless of how the account was created.
Take a look at what environment variables need to be set and checkout Google's OAuth2 docs.
Authorization callback URL: https://<POWERUPTIME_HOST>/api/login/oauth2/code/google
Take a look at what environment variables need to be set and checkout GitHub's OAuth2 docs.
Authorization callback URL: https://<POWERUPTIME_HOST>/api/login/oauth2/code/github
Take a look at what environment variables need to be set and checkout Keycloak's OAuth2 docs.
Authorization callback URL: https://<POWERUPTIME_HOST>/api/login/oauth2/code/keycloak
Please note that you have to fill in all variables without a default value.
| Name | Description | Default value | Required |
|---|---|---|---|
POWERUPTIME_HOST |
Host / Domain of the poweruptime instance. | x | |
DOMAIN_NAMES |
A list of domain names allowed for the status pages. Examples: DOMAIN_NAMES="Host(`status.abc.xyz`)", DOMAIN_NAMES="Host(`status1.abc.xyz`) || Host(`status2.abc.xzy`)" |
| Name | Description | Default value | Required |
|---|---|---|---|
DATABASE_HOST |
Hostname or IP address of the database server. | poweruptime-db |
x |
DATABASE_PORT |
Port number used to connect to the database server. | 5432 |
x |
DATABASE_NAME |
Name of the database to be used by the poweruptime. | poweruptime |
x |
DATABASE_USERNAME |
Username for authenticating with the database server. | poweruptime |
x |
DATABASE_PASSWORD |
Password for authenticating with the database server. | x |
| Name | Description | Default value | Required |
|---|---|---|---|
RABBIT_HOST |
Hostname or IP address of the RabbitMQ server. | poweruptime-rabbitmq |
x |
RABBIT_PORT |
Port number used to connect to the RabbitMQ server. | 5672 |
x |
RABBIT_USERNAME |
Username for authenticating with the RabbitMQ server. | poweruptime |
x |
RABBIT_PASSWORD |
Password for authenticating with the RabbitMQ server. | x |
These configuration values only effect the System E-Mail service.
| Name | Description | Default value | Required |
|---|---|---|---|
MAIL_ENABLED |
Whether email functionality is enabled. | true |
x |
MAIL_HOST |
Hostname or IP address of the mail server. | x | |
MAIL_PORT |
Port number used to connect to the mail server. | x | |
MAIL_USERNAME |
Username for authenticating with the mail server. | x | |
MAIL_PASSWORD |
Password for authenticating with the mail server. | x | |
MAIL_SECURITY |
The type of security to use for email communication. (NONE_STARTTLS, TLS) |
NONE_STARTTLS |
x |
MAIL_IGNORE_TLS_ERRORS |
Whether to ignore TLS errors when connecting to the mail server. | false |
x |
| Name | Description | Default value | Required |
|---|---|---|---|
OAUTH2_GOOGLE_CLIENT_ID |
Your Google OAuth2 Client ID from the Google Cloud Console | ||
OAUTH2_GOOGLE_CLIENT_SECRET |
Your Google OAuth2 Client Secret | ||
OAUTH2_GOOGLE_REDIRECT_URI |
Callback URI registered in Google (where Google will redirect) | {POWERUPTIME_HOST}/api/login/oauth2/code/google |
| Name | Description | Default value | Required |
|---|---|---|---|
OAUTH2_GITHUB_CLIENT_ID |
Your GitHub OAuth2 Client ID from GitHub Developer Settings | ||
OAUTH2_GITHUB_CLIENT_SECRET |
Your GitHub OAuth2 Client Secret | ||
OAUTH2_GITHUB_REDIRECT_URI |
Callback URI registered in GitHub (where GitHub will redirect) | {POWERUPTIME_HOST}/api/login/oauth2/code/github |
| Name | Description | Default value | Required |
|---|---|---|---|
OAUTH2_KEYCLOAK_CLIENT_ID |
Your Keycloak Client ID (as configured in the realm’s Clients) | ||
OAUTH2_KEYCLOAK_CLIENT_SECRET |
Your Keycloak Client secret | ||
OAUTH2_KEYCLOAK_REDIRECT_URI |
The callback URI you registered in Keycloak for this application | {POWERUPTIME_HOST}/api/login/oauth2/code/keycloak |
|
OAUTH2_KEYCLOAK_AUTHORIZATION_URI |
Used by your application to initiate the OAuth 2.0/OpenID Connect authorization code flow (e.g. https://<host>/realms/<realm>/protocol/openid-connect/auth) |
||
OAUTH2_KEYCLOAK_ISSUER_URI |
The issuer URI of your Keycloak realm (e.g. https://<host>/realms/<realm>) |
||
OAUTH2_KEYCLOAK_JWK_SET_URI |
The URL where Keycloak publishes its JSON Web Key Set (e.g. https://<host>/realms/<realms>/protocol/openid-connect/certs) |
||
OAUTH2_KEYCLOAK_TOKEN_URI |
The endpoint in Keycloak’s OAuth 2.0 token service (e.g. https://<host>/realms/<realm>/protocol/openid-connect/token) |
||
OAUTH2_KEYCLOAK_USER_INFO_URI |
The OpenID Connect UserInfo endpoint URL (e.g. https://<host>/realms/<realm>/protocol/openid-connect/userinfo) |
||
OAUTH2_KEYCLOAK_USER_NAME_ATTRIBUTE_URI |
The JWT claim or UserInfo field to treat as the principal’s username in your application | sub |
| Name | Description | Default value | Required |
|---|---|---|---|
RATE_LIMIT_ENABLED |
Whether rate limiting is enabled. | true |
x |
RATE_LIMIT_DURATION_IN_SECONDS |
Duration, in seconds, of the rate limiting window. | 240 |
x |
RATE_LIMIT_TRIES |
Maximum number of requests allowed within the rate limiting window. | 40 |
x |
| Name | Description | Default value | Required |
|---|---|---|---|
APPRISE_WORKER_COUNT |
Number of parallel worker processes Apprise will spawn to deliver notifications concurrently. | -2 |
x |
RABBIT_LISTENER_CONCURRENCY |
Number of concurrent RabbitMQ listener instances. | 16 |
x |
RABBIT_LISTENER_MAX_CONCURRENCY |
Upper limit of the concurrent RabbitMQ listener instances. | 16 |
x |
| Name | Description | Default value | Required |
|---|---|---|---|
PUSH_ENABLED |
Whether push notifications are enabled. | true |
x |
TEMP_NOTIFICATIONS_ENABLED |
Whether temporary notifications are enabled for testing purposes. | false |
x |
SWAGGER_ENABLED |
Whether the Swagger/OpenAPI documentation interface is enabled. | false |
x |
LOG_LEVEL |
Log Level of application | ERROR |
x |
| GitHub Registry | Docker Hub |
|---|---|
| Web | Web |
| Backend | Backend |
docker compose -f _base.yml -f local.yml --env-file .env config./pu configWill print the merged config of _base.yml and local.yml file to standard out.
Go to the versions.env file, and change the version you need.
Simply use the IntelliJ Local run configuration or run the following command to start the whole stack locally:
./pu up --local- Web interface: http://localhost/
- API: http://localhost/api
- Traefik dashboard: http://localhost/traefik
- RabbitMQ Management: http://localhost/rabbit/
- Username:
poweruptime - Password:
poweruptime
- Username: