Skip to content

First User Setup

After installing Slink, you need to create your first admin user. There are two approaches: automatic creation via environment variables (recommended for new installations) or manual setup using CLI commands.

When deploying Slink for the first time, you can preconfigure the first admin user using environment variables. This eliminates the need to manually activate users or assign admin roles via CLI commands after installation.

On the first container startup, if the ADMIN_EMAIL environment variable is set, Slink will automatically:

  1. Create a new user account with the specified credentials
  2. Assign the admin role to the user
  3. Activate the account (bypassing approval requirements)

Set the following environment variables in your Docker Compose file or Docker run command:

environment:
- ADMIN_USERNAME=administrator
- ADMIN_PASSWORD=YourSecurePassword123
VariableDescriptionDefaultRequired
ADMIN_EMAILEmail address for the admin user. This triggers automatic admin creation.nullYes
ADMIN_USERNAMEUsername for the admin user.adminNo
ADMIN_PASSWORDPassword for the admin user.nullYes
services:
slink:
image: anirdev/slink:latest
container_name: slink
environment:
- TZ=UTC
- ORIGIN=https://your-domain.com
# Admin user configuration (remove after first startup)
- ADMIN_USERNAME=admin
- ADMIN_PASSWORD=YourSecurePassword123
# Other settings...
- USER_APPROVAL_REQUIRED=true
- IMAGE_MAX_SIZE=15M
volumes:
- ./slink/var/data:/app/var/data
- ./slink/images:/app/slink/images
ports:
- '3000:3000'

If you prefer to set up your first user manually, or if you didn’t configure the admin environment variables during installation, follow these steps:

  1. Open your browser and navigate to the signup page: https://your-domain.com/profile/signup
  2. Fill in the registration form with your details
  3. Submit the form to create your account

If you have USER_APPROVAL_REQUIRED=true in your configuration, your account needs to be activated before you can log in:

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

Grant yourself admin privileges:

Terminal window
docker exec -it slink slink user:grant:role --email=<your-email> ROLE_ADMIN

Navigate to the login page and use your credentials to access the application as an admin user.