Skip to content

User Creation via CLI

The user:create command allows you to manually create user accounts via the command line interface. This is useful for administrative purposes or automated setup scenarios.

To create a new user with interactive password prompt:

Terminal window
docker exec -it slink slink user:create --email=<email> --username=<username>

The command will prompt you to enter a password interactively.

Example:

Terminal window
docker exec -it slink slink user:create [email protected] --username=johnsmith

You can optionally provide a custom display name:

Terminal window
docker exec -it slink slink user:create --email=<email> --username=<username> --display-name="<display-name>"

Example:

Terminal window
docker exec -it slink slink user:create [email protected] --username=johnsmith --display-name="John Smith"

If no display name is provided, the username will be used as the display name.

Specify the user’s email address:

Terminal window
docker exec -it slink slink user:create --email=<email> --username=<username>

Specify the username:

Terminal window
docker exec -it slink slink user:create --email=<email> --username=<username>

Provide a custom display name (optional):

Terminal window
docker exec -it slink slink user:create --email=<email> --username=<username> --display-name="<display-name>"

Provide the password directly without interactive prompt (short form: -p):

Terminal window
docker exec -it slink slink user:create --email=<email> --username=<username> --password="<password>"

Example:

Terminal window
docker exec -it slink slink user:create [email protected] --username=johnsmith --password="SecurePass123!"

Immediately activate the user account upon creation (short form: -a):

Terminal window
docker exec -it slink slink user:create --email=<email> --username=<username> --activate

Example:

Terminal window
docker exec -it slink slink user:create [email protected] --username=johnsmith --activate

You can combine multiple options together:

Terminal window
docker exec -it slink slink user:create --email=<email> --username=<username> --display-name="<display-name>" --password="<password>" --activate

Example:

Terminal window
docker exec -it slink slink user:create [email protected] --username=johnsmith --display-name="John Smith" --password="SecurePass123!" --activate

Create an inactive user for later activation

Section titled “Create an inactive user for later activation”
Terminal window
docker exec -it slink slink user:create [email protected] --username=alice
# When prompted, enter a secure password

User will be created in inactive status and can be activated later using the user:activate command.

Terminal window
docker exec -it slink slink user:create [email protected] --username=admin --display-name="System Administrator" --password="AdminPass123!" --activate

Then grant admin role:

Terminal window
docker exec -it slink slink user:grant:role [email protected] ROLE_ADMIN

If you try to create a user with an email that already exists:

Error: User with this email already exists.

If the username is already taken:

Error: User with this username already exists.

If the password doesn’t meet complexity requirements:

Error: Password must contain uppercase, lowercase, numbers, and special characters.

If the email format is invalid:

Error: This value is not a valid email address.