Linkstack
Stack
Self-hosted open-source Linktree alternative. LinkStack is a highly customizable link sharing platform with an intuitive, easy to use user interface.
Image details
Source details
Configuration
TypeComposelinuxlinkstackorg/linkstack:latest8188:808190:443/htdocs : linkstack_dataTZ=Europe/AthensSERVER_ADMIN=admin@example.comHTTP_SERVER_NAME=example.comHTTPS_SERVER_NAME=example.comLOG_LEVEL=infoPHP_MEMORY_LIMIT=256MUPLOAD_MAX_FILESIZE=8Munless-stoppedStandalone Install
Select an install method, to see config/commands for deploying Linkstack
Install on Portainer
Import all app templates into your Portainer instance, for easy 1-click deploys
- Ensure both Docker and Portainer are installed, and up-to-date
- Log into your Portainer web UI
- Under Settings → App Templates, paste the below URL
- Head to Home → App Templates, and the list of apps will show up
- Select Linkstack, fill in any config options, and hit Deploy
Template Import URL
https://raw.githubusercontent.com/Lissy93/portainer-templates/main/templates.json
Show Me
Original stackfile
The compose file this template deploys, straight from its repo:
services:
linkstack:
hostname: linkstack
image: linkstackorg/linkstack:latest
environment:
TZ: Europe/Athens
SERVER_ADMIN: admin@example.com
HTTP_SERVER_NAME: example.com
HTTPS_SERVER_NAME: example.com
LOG_LEVEL: info
PHP_MEMORY_LIMIT: 256M
UPLOAD_MAX_FILESIZE: 8M
volumes:
- linkstack_data:/htdocs
ports:
- 8188:80
- 8190:443
restart: unless-stopped
volumes:
linkstack_data:
driver: local
driver_opts:
type: none
device: "/mnt/extra/portainer/Files/AppData/Config/linkstack"
o: bind
Or deploy it directly from the source:
git clone https://github.com/xneo1/portainer_templates
cd portainer_templates
docker compose -f Template/Stack/linkstack.yml up -dMore install options in our documentation, or see linkstackorg/linkstack for app-specific guidance.
<img width="400px" src="https://raw.githubusercontent.com/LinkStackOrg/branding/main/badges/png/website_dark.png">
Docker Edition
Pull, deploy, enjoy!
About • About LinkStack • Pull • Supported Architectures • Deployment • Updating • Build • Persistent storage • Reverse Proxy
About
The official docker version of LinkStack. This docker image is a simple to set up solution, containing everything you need to run LinkStack.The docker version of LinkStack retains all the features and customization options of the original version.
This docker is based on Alpine Linux, a Linux distribution designed to be small, simple and secure. The web server is running Apache2, a free and open-source cross-platform web server software. The docker comes with PHP 8.0 for high compatibility and performance.
Using the docker is as simple as pulling and deploying.
About LinkStack
LinkStack is a highly customizable link sharing platform with an intuitive, easy to use user interface.
LinkStack allows you to create a personal profile page. Many social media platforms only allow for one link. With this, you can have all the links you want clickable on one site. Set up your personal site on your own server in a few clicks.
Learn more about LinkStack, and all the features here:
Pull
docker pull linkstackorg/linkstackAlternative mirror:
docker pull ghcr.io/linkstackorg/linkstackSupported Architectures
Deployment
You may change port 80, 443 to your preferred values.Both HTTP and HTTPS are supported and exposed by default.
Optional environment variables
SERVER_ADMIN(the email, defaults toyou@example.com)HTTP_SERVER_NAME(the server name, defaults tolocalhost)HTTPS_SERVER_NAME(the server name, defaults tolocalhost)LOG_LEVEL(the log level, defaults toinfo)TZ(the timezone, defaults toUTC)PHP_MEMORY_LIMIT(the memory-limit, defaults to256M)UPLOAD_MAX_FILESIZE(the uploadmaxfilesize, defaults to8M)
Deploy
Read more about persistent storage
Create a new volume:
docker volume create linkstack
docker run --detach \
--name linkstack \
--publish 80:80 \
--publish 443:443 \
--restart unless-stopped \
--mount source=linkstack,target=/htdocs \
linkstackorg/linkstack
Custom deployment
docker run --detach \
--name linkstack \
--hostname linkstack \
--env HTTP_SERVER_NAME="www.example.xyz" \
--env HTTPS_SERVER_NAME="www.example.xyz" \
--env SERVER_ADMIN="admin@example.xyz" \
--env TZ="Europe/Berlin" \
--env PHP_MEMORY_LIMIT="512M" \
--env UPLOAD_MAX_FILESIZE="16M" \
--publish 80:80 \
--publish 443:443 \
--restart unless-stopped \
--mount source=linkstack,target=/htdocs \
linkstackorg/linkstack
Docker Compose
Use HTTPS for your reverse proxy to avoid issuesExample config.
version: "3.8"
services:
linkstack:volumes: linkstackdata:hostname: 'linkstack' image: 'linkstackorg/linkstack:latest' environment: TZ: 'Europe/Berlin' SERVER_ADMIN: 'admin@example.com' HTTP_SERVER_NAME: 'example.com' HTTPS_SERVER_NAME: 'example.com' LOG_LEVEL: 'info' PHP_MEMORY_LIMIT: '256M' UPLOAD_MAX_FILESIZE: '8M' volumes: - 'linkstack_data:/htdocs' ports: - '8190:443' restart: unless-stopped
Updating
When a new version is released, you will get an update notification on your Admin Panel.Automatic one click Updater
This updater allows you to update your installation with just one click.How to use the Automatic Updater:
- To update your instance, click on the update notification on your Admin Panel.
- Click on “Update automatically” and the updater will take care of the rest.
Build
If you wish to build or modify your own docker version of LinkStack, you can do so with the instructions below:- Download this GitHub repository as well as the latest release of LinkStack from here.
- Place the downloaded release files directly into the linkstack folder from this repository.
From the docker directory, run the command:
docker build -t linkstack .You can now set up your application on your defined ports.
Persistent storage
Persistent storage for docker containers is storage that is not lost when the container is stopped or removed.This is advantageous since it means that data may be saved even if the container is removed. This is especially crucial when dealing with data that must be retained throughout restarts, such as a database.
All files important to run LinkStack are stored in the "htdocs" folder found in the root directory of your docker container.
We recommend mounting that entire folder to an external volume.
However, some user may prefer to preserve only individual files.
Expand the details section below to read more about this:
/htdocs/.env
/htdocs/database/database.sqlite
/htdocs/config/advanced-config.php
/htdocs/assets/linkstack/images/avatar.png
/htdocs/themes (folder)
/htdocs/assets/img (folder)This might change with future releases.
Reverse Proxy
NGINX:
Below is an example NGINX setup for a reverse proxy.Make sure to use HTTPS to access your container to avoid mixed content errors
:443 ssl; listen 80; listen :::80; servername your.domain.name;
server { listen 443 ssl; listen ::
location / {
# Replace with the IP address and port number of your Docker container.
proxy_pass https://127.0.0.1:443;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-VerifiedViaNginx yes;
proxy_read_timeout 60;
proxy_connect_timeout 60;
proxy_redirect off;
# Specific for websockets: force the use of HTTP/1.1 and set the Upgrade header
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Forwarded-Proto $scheme;
# Fixes Mixed Content errors.
add_header 'Content-Security-Policy' 'upgrade-insecure-requests'; }
}Serve Linkstack on your own domain behind Caddy, Nginx or Traefik. Fill in your domain and copy the result. It's a starting point, some apps need their own base URL or extra headers set too.
Proxying linkstack.example.com to http://linkstack:80
Add this to your Caddyfile
linkstack.example.com {
reverse_proxy http://linkstack:80
}Check the logs first
Nine times out of ten the logs tell you exactly what went wrong.
- In Portainer, go to Containers, click the container, then Logs. Or run
docker logs <container> - Exit codes help too:
137means killed, usually out of memory.126or127means the command inside the image is broken.
Port already in use
If deployment fails with "Bind for 0.0.0.0:8188 failed: port is already allocated", something else on your server is using that port.
- Find what's using it:
sudo ss -tlnp | grep :8188 - Stop the other service, or pick a different host port. In
8188:80only the left number is yours to change, the right one belongs to the app.
Running but the page won't load
The container is up but nothing appears in your browser.
- Use your server's real IP:
http://your-server-ip:8188. The 0.0.0.0 link Portainer shows isn't a real address. - Give it a minute after first deploy, linkstack can take a while to initialise.
- Make sure your firewall allows the port, e.g.
sudo ufw allow 8188
Image won't pull
Test the pull directly on the host: docker pull linkstackorg/linkstack:latest
- "manifest unknown" means the tag no longer exists. This template uses
latest, so try pinning a specific version instead. - "toomanyrequests" is the Docker Hub rate limit. Log in with
docker loginto raise it. - "no space left on device" means a full disk. Reclaim space with
docker system prune
"exec format error"
This means the image was built for a different CPU architecture than your server.
- This image supports:
amd64, arm64, arm/v7, arm/v6 - Check yours with
uname -m: x86_64 is amd64, aarch64 is arm64. Raspberry Pi and other ARM boards are the usual culprits.
Container keeps restarting
The unless-stopped restart policy relaunches the app after every crash, so the real error can scroll past.
- Check the logs right after a restart, the last few lines before it died are the useful ones.
- Get the exit code with
docker inspect <container> --format '{{.State.ExitCode}}' - Still stuck? Redeploy once with the restart policy set to
noso the failure stays visible.
Stack won't deploy
Compose stacks fail fast on small mistakes, and Portainer shows the reason just above the editor.
- YAML only accepts spaces for indentation, a single tab breaks the whole file.
Raise an issue
Found something which isn't working as it should? Here's how to report it.
- Bug within the app: Open an issue on linkstackorg/linkstack
- Template not working: Open an issue on xneo1/portainer_templates
- This website not working: Open an issue on lissy93/portainer-templates
A Compose stack
Linkstack is a Compose stack, a set of containers defined in one file and brought up together by Portainer, then started and stopped as a single app.
The app image
An image is the app packed up ready to go, everything Linkstack needs bundled into one download. This template pulls linkstackorg/linkstack:latest, which Docker fetches once (about 81 MB) and then starts your own copy from.
Where the image comes from
Docker pulls its images from registries, public libraries of ready-built apps. Linkstack's comes from Docker Hub, published by linkstackorg.
Version tags
The bit after the colon in the image name is the version tag. Here it's latest, which always points at the newest build, so a redeploy can bump you to a newer release without you asking. Pin a specific tag if you would rather stay on one version.
Which machines it runs on
Every image is built for particular CPU types. This one ships for amd64, arm64, arm/v7, arm/v6, so it runs on both regular x86 servers and ARM boards like a Raspberry Pi.
Ports
A port is the door the app answers on. A mapping like 8188:80 means it's reachable on port 8188 of your server, where the left number is yours to change and the right one belongs to the app. Once it's running, open http://your-server-ip:8188 in a browser. It opens:
8188:80, likely the web interface8190:443, likely the web interface
Volumes
A volume is where Linkstack keeps its files so they survive an update or a restart. Without one, anything it saves would sit inside the container and vanish the moment it's recreated. This template mounts:
/htdocskept in thelinkstack_datavolume Docker manages
Environment variables
Environment variables are the settings you hand over when you deploy, things like a password or a timezone. Linkstack takes 7 of them, all with defaults you can leave alone or tweak:
TZ, defaults toEurope/AthensSERVER_ADMIN, defaults toadmin@example.comHTTP_SERVER_NAME, defaults toexample.comHTTPS_SERVER_NAME, defaults toexample.comLOG_LEVEL, defaults toinfoPHP_MEMORY_LIMIT, defaults to256MUPLOAD_MAX_FILESIZE, defaults to8M
Restart policy
The restart policy here is unless-stopped, so Docker restarts Linkstack after a crash or reboot, but leaves it off when you stop it on purpose. You can change this on the deploy screen. The choices are no (never restart), on-failure (only after a crash), unless-stopped (restart unless you stop it), and always (bring it back no matter what).
Networking
Nothing custom is set, so Linkstack sits on Docker's default bridge network: its own private space that reaches the outside world only through the ports it publishes.
Container name
Once it's deployed, Portainer names the container linkstack. That's what you'll spot in the containers list and use in commands like docker logs linkstack.
Platform
The platform is linux, the kind of system the container is built to run on. Docker and Portainer handle this on a normal Linux server.
Open source license
Linkstack is open source, released under the AGPL-3.0 license. In plain terms the code is out in the open, so you're free to run it and change it to fit what you need.
Portainer app templates
Zooming out, this whole page comes from a Portainer app template: a short recipe telling Portainer how to set Linkstack up. Add the template list to Portainer once, then deploying Linkstack is a click rather than a wall of config.