
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 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:
- A web server (Apache, Nginx, etc.)
- PHP 7.4+
- MySQL/MariaDB database
- Optionally, tools like Composer for dependency management
💡 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:
- GitHub
- Resume PDF
- Portfolio Website
- Contact Email
All neatly organized on one page.
🧾 Prerequisites
Before we start, make sure you have:
- A VPS running on AlmaLinux 8 or AlmaLinux 9
- A non-root user with sudo privileges (See Guide: How to Create Sudo User in RHEL)
- A fully-qualified domain name (Cheap domain registration👉Register a Domain)
- Basic knowledge of SSH and Linux terminal
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:
-
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
-
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
-
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).
-
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. -
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
-
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
-
Enable
.htaccess
SupportEdit 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
-
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.
-
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
-
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
-
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.
-
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.
-
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
-
Request the SSL Certificate
Make sure your Apache virtual host is correctly configured for your domain (
ServerName
andServerAlias
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.
-
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.
-
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.
-
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 ✅

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