Skip to main content

password

Summary

The scloud password command provides management of passwords for Serverpod Cloud projects. Passwords are automatically prefixed with SERVERPOD_PASSWORD_ and will be injected as environment variables. Passwords defined by this command can be accessed with Serverpod's getPassword() function.

Use this command when you need to manage passwords that will be accessed via Serverpod's getPassword() API, such as database passwords, JWT secrets, or email service passwords.

Setting Passwords

To set a password, use the set command:

scloud password set database "my_database_password"

The password name should be provided without the SERVERPOD_PASSWORD_ prefix. The prefix is automatically added by Serverpod Cloud.

You can also set a password from a file:

scloud password set database --from-file password.txt

Listing Passwords

To list all passwords (both user-set and platform-managed):

scloud password list

This displays passwords grouped by category: Custom, Services, Auth, and Legacy Auth.

Unsetting Passwords

To remove a user-set password:

scloud password unset database
note

If you need to set a secret without the SERVERPOD_PASSWORD_ prefix, you can do so by using the secret create command.

For detailed information about when to use passwords vs secrets vs variables, see the Configuration Management guide.

Usage

Manage Serverpod Cloud passwords.

The passwords are automatically prefixed with SERVERPOD_PASSWORD_ and will be injected as
environment variables.
Passwords defined by this command can be accessed with the getPassword function.

If you need to set a secret without the SERVERPOD_PASSWORD_ prefix, you can do so by using the
secret create command.


Usage: scloud password <subcommand> [arguments]
-h, --help Print this usage information.

Available subcommands:
list List all passwords, both user-set and platform-managed.
set Set a password.
unset Unset a password, can only unset user-set passwords.

Run "scloud help" to see global options.

See the full documentation at: https://docs.serverpod.cloud/references/cli/commands/password

Sub commands

list

List all passwords, both user-set and platform-managed.

Passwords are grouped by category:
- Custom: User-defined passwords that are not part of the platform.
- Services: Passwords for services like databases, insights, etc.
- Auth: Passwords for authentication like JWT, email, for package serverpod_auth_idp_server.
- Legacy Auth: Passwords for the legacy authentication module.


Usage: scloud password list [arguments]
-h, --help Print this usage information.
-p, --project (mandatory) The ID of the project.
Can be omitted for existing projects that are linked. See `scloud
project link --help`.

Run "scloud help" to see global options.

See the full documentation at: https://docs.serverpod.cloud/references/cli/commands/password

set

Set a password.

Setting a platform-managed password will override the existing password.
The original password will not be lost and can be activated again by unsetting the password.


Usage: scloud password set [arguments]
-h, --help Print this usage information.
-p, --project (mandatory) The ID of the project.
Can be omitted for existing projects that are linked. See `scloud
project link --help`.
--name (mandatory) The name of the password (without SERVERPOD_PASSWORD_ prefix). Can be
passed as the first argument.

Value
--value The value of the password. Can be passed as the second argument.
--from-file The name of the file with the password value.

Run "scloud help" to see global options.

See the full documentation at: https://docs.serverpod.cloud/references/cli/commands/password

unset

Unset a password, can only unset user-set passwords.

Usage: scloud password unset [arguments]
-h, --help Print this usage information.
-p, --project (mandatory) The ID of the project.
Can be omitted for existing projects that are linked. See `scloud
project link --help`.
--name (mandatory) The name of the password (without SERVERPOD_PASSWORD_ prefix). Can be
passed as the first argument.

Run "scloud help" to see global options.

See the full documentation at: https://docs.serverpod.cloud/references/cli/commands/password