Skip to content

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
└── .dockerignore

Creating the Dockerfile

FROM linkstackorg/linkstack:latest
# Environment configuration
ENV SERVER_ADMIN=admin@example.com
ENV HTTP_SERVER_NAME=localhost
ENV HTTPS_SERVER_NAME=localhost
ENV LOG_LEVEL=info
ENV 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 port
EXPOSE 80 443
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
CMD curl -f http://localhost/ || exit 1

Creating the .dockerignore File

.git
.github
*.md
LICENSE
.gitignore
*.log
.DS_Store
.env
.env.local
vendor/

Environment Variables Reference

VariableRequiredDefaultDescription
HTTP_SERVER_NAMENolocalhostHTTP server hostname
HTTPS_SERVER_NAMENolocalhostHTTPS server hostname
TZNoUTCTimezone
DB_CONNECTIONNosqliteDatabase type (sqlite or mysql)
DB_HOSTNo-MySQL hostname (if using MySQL)
DB_DATABASENolinkstackDatabase name
DB_USERNAMENo-Database username
DB_PASSWORDNo-Database password

Deploying LinkStack on Klutch.sh

    Push Your Repository to GitHub

    Terminal window
    git init
    git add Dockerfile .dockerignore README.md
    git commit -m "Initial LinkStack deployment configuration"
    git remote add origin https://github.com/yourusername/linkstack-deploy.git
    git push -u origin main

    Create 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:

    • Select HTTP as the traffic type
    • Set the internal port to 80

    Set Environment Variables

    Add the following:

    VariableValue
    HTTP_SERVER_NAMEyour-app.klutch.sh
    HTTPS_SERVER_NAMEyour-app.klutch.sh
    TZYour timezone

    For MySQL (optional):

    VariableValue
    DB_CONNECTIONmysql
    DB_HOSTYour MySQL hostname
    DB_DATABASElinkstack
    DB_USERNAMEYour database username
    DB_PASSWORDYour database password

    Attach Persistent Volumes

    Mount PathRecommended SizePurpose
    /htdocs/database1 GBSQLite database (if using SQLite)
    /htdocs/storage5 GBUploads and cached files

    Deploy Your Application

    Click Deploy to start the build process.

    Complete Setup

    Access LinkStack and complete the initial setup wizard:

    1. Navigate to https://your-app.klutch.sh
    2. Create admin account
    3. Configure basic settings

Initial Configuration

Admin Setup

Configure your instance:

  1. Log in as administrator
  2. Navigate to Admin Panel
  3. Configure site settings
  4. Set up email if needed

Creating Your Page

Build your link page:

  1. Add your profile picture
  2. Enter your bio
  3. Add links with icons
  4. Customize colors and layout

Custom Branding

Remove default branding:

  1. Go to Admin > Config
  2. Disable footer credits if desired
  3. Add custom CSS for styling
  4. Upload custom favicon

Using LinkStack

Populate your page:

  1. Navigate to Links
  2. Click Add Link
  3. Enter URL and title
  4. Select icon or upload custom
  5. Save and reorder as needed

Social Buttons

Add social profiles:

  1. Use pre-configured social buttons
  2. Enter your username/URL
  3. Icons and colors apply automatically

Themes

Customize appearance:

  1. Browse available themes
  2. Apply theme to your page
  3. Customize colors if supported
  4. Add custom CSS for advanced changes

Multi-User Setup

For hosting multiple users:

  1. Enable registration or create accounts manually
  2. Assign unique page URLs
  3. Configure permissions
  4. 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

  1. Back up database regularly
  2. Back up storage directory
  3. 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

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.