LinkStack with Docker Self-hosted Linktree Alternative
Learn how to set up LinkStack, a self-hosted Linktree alternative, using Docker for simple and easy deployment.
Docker
Create a folder named linkstack:
mkdir ~/docker
cd ~/docker
mkdir linkstack
Create docker-compose.yml:
nano docker-compose.yml
Modify docker-compose.yml and save the changes:
version: "3.8"
services:
linkstack:
hostname: 'linkstack'
image: 'linkstackorg/linkstack:latest'
environment:
TZ: 'America/Los_Angeles'
SERVER_ADMIN: '[email protected]'
HTTP_SERVER_NAME: 'www.example.com'
HTTPS_SERVER_NAME: 'www.example.com'
LOG_LEVEL: 'info'
PHP_MEMORY_LIMIT: '256M'
UPLOAD_MAX_FILESIZE: '8M'
volumes:
- 'linkstack:/htdocs'
ports:
- '8442:443'
restart: unless-stopped
volumes:
linkstack:
Update TZ
, SERVER_ADMIN
, HTTP_SERVER_NAME
, and HTTPS_SERVER_NAME
. Find your timezone code at PHP List of Supported Timezones.
(Retrieved from LinkStack Docker Hub on September 15, 2024)
Start Docker:
docker compose up -d
Reverse Proxy
Install Caddy:
sudo apt install caddy
Open Caddyfile:
sudo nano /etc/caddy/Caddyfile
Update Caddyfile:
example.com {
route / {
redir https://www.{host}
}
}
www.example.com {
reverse_proxy localhost:8442 {
transport http {
tls_insecure_skip_verify
}
}
}
(Retrieved from LinkStack documentation on September 15, 2024)
If someone visits https://example.com, they are automatically sent to https://www.example.com instead. It makes LinkStack the main page for your website.
Restart Caddy:
sudo systemctl restart caddy
LinkStack
Go to LinkStack at https://example.com. You can access the login page at https://www.example.com/login.
Set database type to sqlite.
Disable registration and email verification.
Set your page as the Home Page if you’re the only user. If you do, your LinkStack profile link will be https://www.example.com; otherwise, it will be https://www.example.com/@username.
To hide the LinkStack logo, log in and go to Admin > Config. In the Footer Links section, uncheck “Show Footer,” “Display Credit on User Pages,” and “Display Credit in Footer”.