Manage users via CLI
The gotify-server user commands (available since 3.2.0) change users directly in the database. Use them to recover access when you lost the admin password or no admin account is left.
WARNING
Stop the server before running the commands, Gotify may not work correctly when users are changed while the server is running.
# change the password of a user
$ gotify-server user set-password admin
# create a new user, --admin makes it an admin
$ gotify-server user create --admin rescue
# grant or revoke admin permissions
$ gotify-server user set-admin alice trueWithout a password argument, you are prompted for it. You can also pass it as the last argument, e.g. gotify-server user set-password admin newpassword, but it may then show up in your shell history.
Configuration
The commands load the configuration as described in Configuration. Run them with the same configuration and in the same working directory as the server.
Docker
Run the command with the same image version, volumes, environment variables and config file as your server. Otherwise it may use a different database or migrate it to a newer version.
# docker compose
$ docker compose stop <gotify-service-name>
$ docker compose run --rm <gotify-service-name> user set-password admin
$ docker compose start <gotify-service-name>
# docker
$ docker stop <gotify-container-name>
$ docker run --rm -it -v /var/gotify/data:/app/data gotify/server:<gotify-version> user set-password admin
$ docker start <gotify-container-name>