...
How to run self-hosted link-in-bio tool with linkstack on almalinux vps
Run your own self-hosted link-in-bio tool with linkstack on almalinux vps!

This article provides a guide for how to run self-hosted Link-in-Bio tool with LinkStack on AlmaLinux VPS.

πŸ› οΈ How to Run Self-Hosted Link-in-Bio Tool with LinkStack on AlmaLinux VPS

This guide walks you through installing and running LinkStack, a free and open-source alternative to Linktree, on an AlmaLinux VPS.

What is LinkStack?

Linkstack - self-hosted open-source linktree alternative

πŸ”— LinkStack is a self-hosted, open-source link sharing platform that allows users to create a personalized landing page containing a list of linksβ€”commonly used for social media bios, portfolios, or contact hubs. It’s akin to platforms like Linktree, but with the flexibility of being hosted on your own server-under your control and customized to your specific project needs!

πŸ” Key Features of LinkStack:

  • Self-Hosting: Deploy it on your own server (e.g., Apache or Nginx with PHP support).
  • Customization: Modify the look and feel to match your branding.
  • No Limits: Unlike many freemium SaaS alternatives, you control everythingβ€”no paywalls.
  • Responsive UI: Mobile-friendly and adaptable for various screen sizes.
  • Analytics: Basic tracking of link clicks (depending on the version/fork).

πŸ› οΈ Technical Requirements:

πŸ’‘ Typical Use Case:

Imagine you’re a developer, artist, or influencerβ€”you’d use LinkStack to create a page like:

yourdomain.com/links

Where you’d list:

  • Instagram
  • GitHub
  • Resume PDF
  • Portfolio Website
  • Contact Email

All neatly organized on one page.

🧾 Prerequisites

Before we start, make sure you have:

Launch 100% ssd almalinux vps from $2. 49/mo!

How to Run Self-Hosted Link-in-Bio Tool with LinkStack on Your AlmaLinux VPS

To run self-hosted Link-in-Bio tool with LinkStack on AlmaLinux VPS, follow the steps provided below:

  1. Connect to Your VPS

    Open your terminal and connect to the VPS via SSH.

    ssh your_user@your_server_ip
    

    Update your system:

    sudo dnf update -y
    
  2. Install Required Packages

    Install Apache, PHP, and MariaDB (LAMP stack).

    dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
    dnf -y install https://rpms.remirepo.net/enterprise/remi-release-8.rpm
    dnf -y install yum-utils
    dnf module reset php -y
    dnf module install php:remi-8.2 -y
    dnf update -y
    sudo dnf install -y httpd mariadb-server php php-mysqlnd php-zip php-bcmath php-pdo php-json php-gd php-mbstring php-xml php-cli unzip git
    

    Start and enable Apache:

    sudo systemctl start httpd
    sudo systemctl enable httpd
    

    Start and enable MariaDB:

    sudo systemctl start mariadb
    sudo systemctl enable mariadb
    
  3. Secure the Database Server

    Run the MariaDB secure installation script:

    sudo mysql_secure_installation
    
    • Press Enter for current root password (leave blank).
    • Set a root password.
    • Answer Y to all prompts (remove anonymous users, disallow root remote login, remove test DB, reload privileges).
  4. Create LinkStack Database and User

    Log into MariaDB:

    sudo mysql -u root -p
    

    Inside the MySQL prompt:

    CREATE DATABASE linkstack;
    CREATE USER 'linkuser'@'localhost' IDENTIFIED BY 'your_secure_password';
    GRANT ALL PRIVILEGES ON linkstack.* TO 'linkuser'@'localhost';
    FLUSH PRIVILEGES;
    EXIT;
    

    Replace your_secure_password with something secure.

  5. Download and Set Up LinkStack

    Change to the Apache web directory:

    cd /var/www/html
    

    Remove the default index page (optional):

    sudo rm -f index.html
    

    Clone the LinkStack repo:

    sudo git clone https://github.com/LinkStackOrg/LinkStack.git
    

    Move into the LinkStack directory:

    cd LinkStack
    

    Set correct permissions:

    sudo chown -R apache:apache /var/www/html/LinkStack
    sudo chmod -R 755 /var/www/html/LinkStack
    
  6. Configure Apache for LinkStack

    Create a new Apache config file:

    sudo nano /etc/httpd/conf.d/linkstack.conf
    

    Paste this configuration (replace yourdomain.com):

    <VirtualHost *:80>
        ServerAdmin webmaster@yourdomain.com
        DocumentRoot /var/www/html/LinkStack
        ServerName yourdomain.com
        ServerAlias www.yourdomain.com
    
        <Directory /var/www/html/LinkStack>
            Options Indexes FollowSymLinks
            AllowOverride All
            Require all granted
        </Directory>
    
        ErrorLog /var/log/httpd/linkstack_error.log
        CustomLog /var/log/httpd/linkstack_access.log combined
    </VirtualHost>
    

    Save and exit (Ctrl+O, Enter, Ctrl+X).

    Restart Apache:

    sudo systemctl restart httpd
    
  7. Enable .htaccess Support

    Edit Apache main config file:

    sudo nano /etc/httpd/conf/httpd.conf
    

    Find this block:

    <Directory "/var/www">
        AllowOverride None
    

    Change it to:

    <Directory "/var/www">
        AllowOverride All
    

    Save and exit. Then restart Apache:

    sudo systemctl restart httpd
    
  8. Set Up LinkStack Environment

    Rename the example environment file:

    cp .env.example .env
    

    Edit the .env file:

    nano .env
    

    Update the DB settings:

    DB_CONNECTION=mysql
    DB_HOST=127.0.0.1
    DB_PORT=3306
    DB_DATABASE=linkstack
    DB_USERNAME=linkuser
    DB_PASSWORD=your_secure_password
    

    Save and exit.

  9. Install Composer and Dependencies

    Install Composer:

    php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
    php composer-setup.php
    sudo mv composer.phar /usr/local/bin/composer
    

    Now install PHP dependencies:

    composer install --no-dev
    
  10. Set App Key and Run Migrations

    Generate app key:

    php artisan key:generate
    

    Run database migrations:

    php artisan migrate --force
    

    Set permissions again:

    sudo chown -R apache:apache .
    sudo chmod -R 775 storage bootstrap/cache
    
  11. Access LinkStack Web Interface

    Now visit your server IP or domain in a browser:

    http://yourdomain.com
    

    You’ll see the LinkStack welcome screen. Create an admin user and start building your bio page.

    Visit linkstack in browser

  12. Set Up Cron for Laravel

    Add a cron job to run Laravel’s scheduler:

    sudo crontab -e
    

    Add this line:

    * * * * * cd /var/www/html/LinkStack && php artisan schedule:run >> /dev/null 2>&1
    

    Save and exit.

πŸŽ‰ Done!

You now have a self-hosted, customizable Link-in-Bio tool running on AlmaLinux with LinkStack.

πŸ“Œ Tips

  • Backup .env and database regularly.
  • Check logs: storage/logs/laravel.log
  • Customize themes and settings in the admin panel.

Next, we need to encrypt LinkStack’s web server with SSL encryption! (Can’t have your Links page scaring people away with browser warning! β›”πŸ˜±)

πŸ” Step-by-Step: Install SSL with Certbot on AlmaLinux + Apache

This will give your LinkStack site a free HTTPS certificate from Let’s Encrypt and keep it automatically renewed.

  1. Install EPEL Repository and Certbot

    sudo dnf install -y epel-release
    

    Then install Certbot and the Apache plugin:

    sudo dnf install -y certbot python3-certbot-apache
    
  2. Request the SSL Certificate

    Make sure your Apache virtual host is correctly configured for your domain (ServerName and ServerAlias match the DNS records).

    Then run:

    sudo certbot --apache
    

    You’ll be prompted to:

    • Enter your email
    • Agree to the terms
    • Choose whether to redirect HTTP to HTTPS (select option 2 for redirect)

    Certbot will automatically configure Apache for HTTPS and reload it.

  3. Confirm HTTPS is WorkingOpen your browser and go to:

    https://yourdomain.com
    

    You should see the secure padlock πŸ”’ and your LinkStack site loading over HTTPS.

  4. Enable Automatic Renewal

    Certbot already installs a systemd timer to auto-renew your certificates.

    To verify:

    sudo systemctl list-timers | grep certbot
    

    You should see something like:

    NEXT                         LEFT          LAST                         PASSED       UNIT                         ACTIVATES
    2025-04-21 03:22:00 UTC      11h left      2025-04-20 03:22:00 UTC      1h ago       certbot.timer                certbot.service
    

    This means it checks twice a day and renews if necessary.

  5. Test Renewal

    Always good to test manually:

    sudo certbot renew --dry-run
    

    If you see β€œCongratulations, all renewals succeeded,” you’re good to go.

πŸŽ‰ That’s It β€” SSL is Live and Auto-Renewing

Your LinkStack site is now:

  • βœ… Secure with HTTPS
  • πŸ” Set up for auto-renewal
  • πŸ”§ Fully configured via Certbot and Apache

And, finally, we will apply some minor redirection to synchronize the www subdomain to non-www. This ensures a more consistent experience for humans and robots, alike.

Let’s get started:

πŸ” Step-by-Step: Redirect www to Non-www with Apache + SSL

Edit Apache Config

Open your LinkStack Apache config:

sudo nano /etc/httpd/conf.d/linkstack.conf

Replace whatever’s there with the following clean structure:

# Redirect www to non-www
<VirtualHost *:80>
    ServerName www.yourdomain.com
    Redirect permanent / http://yourdomain.com/
</VirtualHost>

# Main non-www config for HTTP
<VirtualHost *:80>
    ServerName yourdomain.com
    DocumentRoot /var/www/html/LinkStack

    <Directory /var/www/html/LinkStack>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

# Redirect HTTPS www to non-www
<VirtualHost *:443>
    ServerName www.yourdomain.com
    SSLEngine on
    SSLCertificateFile /etc/letsencrypt/live/yourdomain.com/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/yourdomain.com/privkey.pem
    Redirect permanent / https://yourdomain.com/
</VirtualHost>

# Main non-www config for HTTPS
<VirtualHost *:443>
    ServerName yourdomain.com
    DocumentRoot /var/www/html/LinkStack

    SSLEngine on
    SSLCertificateFile /etc/letsencrypt/live/yourdomain.com/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/yourdomain.com/privkey.pem

    <Directory /var/www/html/LinkStack>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

⚠ Replace yourdomain.com everywhere with your actual domain name.

Reload Apache

sudo systemctl restart httpd

Test the Redirect

Open your browser and go to:

https://www.yourdomain.com

It should redirect you to:

https://yourdomain.com

Done βœ…

Launch 100% ssd almalinux vps from $1. 99/mo!
Launch 100% ssd almalinux vps from $1. 99/mo!

Conclusion

You now know how to run self-hosted Link-in-Bio tool with LinkStack on AlmaLinux VPS.

Avatar of editorial staff

Editorial Staff

Rad Web Hosting is a leading provider of web hosting, Cloud VPS, and Dedicated Servers in Dallas, TX.
lg