Deploying LinkStack
Introduction
LinkStack is a self-hosted, open-source alternative to Linktree and similar link-in-bio services. With LinkStack, you can create beautiful landing pages that aggregate all your important links in one place, while maintaining complete control over your data and customization options.
Built with PHP, LinkStack offers more flexibility than commercial alternatives without the limitations or recurring costs. Whether you’re an influencer, business, or just someone who wants a central hub for your online presence, LinkStack provides the tools to create professional link pages.
Key highlights of LinkStack:
- Custom Link Pages: Create personalized landing pages with your links
- Social Icons: Pre-configured buttons for major social platforms
- Custom Theming: Design your page with CSS customization
- Analytics: Track click statistics for each link
- Multi-User Support: Host pages for multiple users
- Custom Domains: Use your own domain for each page
- No Branding: Remove all traces of the platform if desired
- Privacy-Focused: No third-party tracking or data collection
- Self-Hosted: Complete control over your data
- Open Source: MIT licensed for maximum freedom
This guide walks through deploying LinkStack on Klutch.sh using Docker.
Why Deploy LinkStack on Klutch.sh
Deploying LinkStack on Klutch.sh provides several advantages:
Simplified Deployment: Klutch.sh automatically builds LinkStack from your Dockerfile. Push to GitHub, and your link pages deploy.
Persistent Storage: Attach persistent volumes for your database and uploads. Your pages survive restarts.
HTTPS by Default: Klutch.sh provides automatic SSL certificates for secure pages.
GitHub Integration: Connect your repository for automatic redeployments.
Minimal Resources: LinkStack is lightweight and efficient.
Environment Variable Management: Configure settings securely.
Custom Domains: Essential for professional link pages.
Always-On Availability: Your link pages remain accessible 24/7.
Prerequisites
Before deploying LinkStack on Klutch.sh, ensure you have:
- A Klutch.sh account
- A GitHub account with a repository for your configuration
- Basic familiarity with Docker and containerization concepts
- (Optional) A MySQL/MariaDB database (SQLite works for small deployments)
- (Optional) A custom domain for your link pages
Understanding LinkStack Architecture
LinkStack uses a simple architecture:
PHP Application: Laravel-based backend handling pages and admin.
Database: SQLite for single-user or MySQL for multi-user deployments.
File Storage: For uploaded images and avatars.
Web Server: Apache or Nginx serving the application.
Preparing Your Repository
Repository Structure
linkstack-deploy/├── Dockerfile├── README.md└── .dockerignoreCreating the Dockerfile
FROM linkstackorg/linkstack:latest
# Environment configurationENV SERVER_ADMIN=admin@example.comENV HTTP_SERVER_NAME=localhostENV HTTPS_SERVER_NAME=localhostENV LOG_LEVEL=infoENV TZ=UTC
# For MySQL (optional)ENV DB_CONNECTION=${DB_CONNECTION:-sqlite}ENV DB_HOST=${DB_HOST:-}ENV DB_PORT=${DB_PORT:-3306}ENV DB_DATABASE=${DB_DATABASE:-linkstack}ENV DB_USERNAME=${DB_USERNAME:-}ENV DB_PASSWORD=${DB_PASSWORD:-}
# Expose portEXPOSE 80 443
# Health checkHEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \ CMD curl -f http://localhost/ || exit 1Creating the .dockerignore File
.git.github*.mdLICENSE.gitignore*.log.DS_Store.env.env.localvendor/Environment Variables Reference
| Variable | Required | Default | Description |
|---|---|---|---|
HTTP_SERVER_NAME | No | localhost | HTTP server hostname |
HTTPS_SERVER_NAME | No | localhost | HTTPS server hostname |
TZ | No | UTC | Timezone |
DB_CONNECTION | No | sqlite | Database type (sqlite or mysql) |
DB_HOST | No | - | MySQL hostname (if using MySQL) |
DB_DATABASE | No | linkstack | Database name |
DB_USERNAME | No | - | Database username |
DB_PASSWORD | No | - | Database password |
Deploying LinkStack on Klutch.sh
- Select HTTP as the traffic type
- Set the internal port to 80
- Navigate to
https://your-app.klutch.sh - Create admin account
- Configure basic settings
Push Your Repository to GitHub
git initgit add Dockerfile .dockerignore README.mdgit commit -m "Initial LinkStack deployment configuration"git remote add origin https://github.com/yourusername/linkstack-deploy.gitgit push -u origin mainCreate a New Project on Klutch.sh
Navigate to the Klutch.sh dashboard and create a new project named “linkstack” or “links”.
Create a New App
Within your project, create a new app. Connect your GitHub account and select your LinkStack repository.
Configure HTTP Traffic
In the deployment settings:
Set Environment Variables
Add the following:
| Variable | Value |
|---|---|
HTTP_SERVER_NAME | your-app.klutch.sh |
HTTPS_SERVER_NAME | your-app.klutch.sh |
TZ | Your timezone |
For MySQL (optional):
| Variable | Value |
|---|---|
DB_CONNECTION | mysql |
DB_HOST | Your MySQL hostname |
DB_DATABASE | linkstack |
DB_USERNAME | Your database username |
DB_PASSWORD | Your database password |
Attach Persistent Volumes
| Mount Path | Recommended Size | Purpose |
|---|---|---|
/htdocs/database | 1 GB | SQLite database (if using SQLite) |
/htdocs/storage | 5 GB | Uploads and cached files |
Deploy Your Application
Click Deploy to start the build process.
Complete Setup
Access LinkStack and complete the initial setup wizard:
Initial Configuration
Admin Setup
Configure your instance:
- Log in as administrator
- Navigate to Admin Panel
- Configure site settings
- Set up email if needed
Creating Your Page
Build your link page:
- Add your profile picture
- Enter your bio
- Add links with icons
- Customize colors and layout
Custom Branding
Remove default branding:
- Go to Admin > Config
- Disable footer credits if desired
- Add custom CSS for styling
- Upload custom favicon
Using LinkStack
Adding Links
Populate your page:
- Navigate to Links
- Click Add Link
- Enter URL and title
- Select icon or upload custom
- Save and reorder as needed
Social Buttons
Add social profiles:
- Use pre-configured social buttons
- Enter your username/URL
- Icons and colors apply automatically
Themes
Customize appearance:
- Browse available themes
- Apply theme to your page
- Customize colors if supported
- Add custom CSS for advanced changes
Multi-User Setup
For hosting multiple users:
- Enable registration or create accounts manually
- Assign unique page URLs
- Configure permissions
- Each user manages their own page
Production Best Practices
Security Recommendations
- Use HTTPS (automatic with Klutch.sh)
- Strong admin password
- Disable registration if not needed
- Keep LinkStack updated
Performance Tips
- Use SQLite for single/few users
- Switch to MySQL for many users
- Enable caching
- Optimize uploaded images
Backup Strategy
- Back up database regularly
- Back up storage directory
- Export page configurations
Troubleshooting
Page Not Loading
- Check deployment status
- Verify HTTP configuration
- Review container logs
Images Not Displaying
- Check storage permissions
- Verify upload completed
- Check file size limits
Custom Domain Issues
- Verify DNS configuration
- Check SSL certificate
- Update server name variables
Additional Resources
- Official LinkStack Website
- LinkStack Documentation
- LinkStack GitHub Repository
- Klutch.sh Persistent Volumes
- Klutch.sh Deployments
Conclusion
Deploying LinkStack on Klutch.sh gives you a professional, self-hosted link-in-bio solution with complete customization control. Unlike commercial services with limitations and fees, LinkStack lets you create the exact page you want.
With automatic builds, persistent storage, and custom domain support, you can build a polished online presence that you own completely.