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.
Automatic Admin User Creation
Section titled “Automatic Admin User Creation”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.
How It Works
Section titled “How It Works”On the first container startup, if the ADMIN_EMAIL environment variable is set, Slink will automatically:
- Create a new user account with the specified credentials
- Assign the admin role to the user
- Activate the account (bypassing approval requirements)
Configuration
Section titled “Configuration”Set the following environment variables in your Docker Compose file or Docker run command:
environment: - ADMIN_USERNAME=administrator - ADMIN_PASSWORD=YourSecurePassword123| Variable | Description | Default | Required |
|---|---|---|---|
ADMIN_EMAIL | Email address for the admin user. This triggers automatic admin creation. | null | Yes |
ADMIN_USERNAME | Username for the admin user. | admin | No |
ADMIN_PASSWORD | Password for the admin user. | null | Yes |
Complete Docker Compose Example
Section titled “Complete Docker Compose Example”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'Manual User Setup
Section titled “Manual User Setup”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:
Step 1: Create a User Account
Section titled “Step 1: Create a User Account”- Open your browser and navigate to the signup page:
https://your-domain.com/profile/signup - Fill in the registration form with your details
- Submit the form to create your account
Step 2: Activate Your Account
Section titled “Step 2: Activate Your Account”If you have USER_APPROVAL_REQUIRED=true in your configuration, your account needs to be activated before you can log in:
docker exec -it slink slink user:activate --email=<your-email>Step 3: Grant Admin Role
Section titled “Step 3: Grant Admin Role”Grant yourself admin privileges:
docker exec -it slink slink user:grant:role --email=<your-email> ROLE_ADMINStep 4: Log In
Section titled “Step 4: Log In”Navigate to the login page and use your credentials to access the application as an admin user.