Skip to content

Docker Compose Installation

Before you begin, make sure you have Docker and Docker Compose installed on your system.

  1. Create a new directory for Slink and navigate to it:

    Terminal window
    mkdir slink-app && cd slink-app
  2. Create a docker-compose.yml file with the following content:

    services:
    slink:
    image: anirdev/slink:latest
    container_name: slink
    # This container runs as root user by default. Uncomment the "user: slink" line below to run as non-root user.
    # See https://docs.slinkapp.io/reference/04-non-root-container-user/ for additional details.
    # user: slink
    environment:
    # Your timezone
    - TZ=UTC
    # Your application hostname (Required for cookies)
    - ORIGIN=https://your-domain.com
    # Require user approval before they can upload images
    - USER_APPROVAL_REQUIRED=true
    # User password requirements
    - USER_PASSWORD_MIN_LENGTH=8
    - USER_PASSWORD_REQUIREMENTS=15 # bitmask of requirements
    # Maximum image size allowed to be uploaded (no more than 50M)
    - IMAGE_MAX_SIZE=15M
    # Image processing settings
    - IMAGE_STRIP_EXIF_METADATA=true
    - IMAGE_COMPRESSION_QUALITY=80
    # Storage provider to use (may require additional configuration variables for different providers, see below)
    - STORAGE_PROVIDER=local
    volumes:
    # Persist the database
    - ./slink/var/data:/app/var/data
    # Persist the uploaded images
    - ./slink/images:/app/slink/images
    ports:
    # Expose the application on port 3000
    - '3000:3000'
  3. Run the following command to start the Slink application:

    Terminal window
    docker-compose up -d
  4. (Optional) If you have USER_APPROVAL_REQUIRED=true, activate your user account:

    Terminal window
    docker exec -it slink slink user:activate --email=<user-email>
  5. (Optional) Grant yourself admin access by running the following command:

    Terminal window
    docker exec -it slink slink user:grant:role --email=<user-email> ROLE_ADMIN
  6. Open your browser and navigate to https://your-domain.com:3000/profile/signup to create a new account.

  7. Login to the Slink application and start uploading images.

If you want to store images on a network share using SMB/CIFS:

services:
slink:
image: anirdev/slink:latest
container_name: slink
environment:
- TZ=UTC
- ORIGIN=https://your-domain.com
# SMB Storage Configuration
- STORAGE_PROVIDER=smb
- SMB_HOST=192.168.1.100
- SMB_SHARE=slink-storage
- SMB_USERNAME=slink-user
- SMB_PASSWORD=secure-password
- SMB_WORKGROUP=workgroup
# Other settings...
- USER_APPROVAL_REQUIRED=true
- IMAGE_MAX_SIZE=15M
volumes:
# Only need to persist the database when using SMB storage
- ./slink/var/data:/app/var/data
ports:
- '3000:3000'

For cloud deployments using AWS S3:

services:
slink:
image: anirdev/slink:latest
container_name: slink
environment:
- TZ=UTC
- ORIGIN=https://your-domain.com
# S3 Storage Configuration
- STORAGE_PROVIDER=s3
- AMAZON_S3_REGION=us-east-1
- AMAZON_S3_BUCKET=my-slink-bucket
- AMAZON_S3_ACCESS_KEY_ID=EXAMPLEKEYID
- AMAZON_S3_SECRET_ACCESS_KEY=exampleSecretKey
# Other settings...
- USER_APPROVAL_REQUIRED=true
- IMAGE_MAX_SIZE=15M
volumes:
# Only need to persist the database when using S3 storage
- ./slink/var/data:/app/var/data
ports:
- '3000:3000'