<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Maxim Cravtov</title>
    <description>The latest articles on DEV Community by Maxim Cravtov (@maxim_cravtov).</description>
    <link>https://dev.to/maxim_cravtov</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3450451%2F481b8373-2a2f-49b5-a3df-f633e051730e.png</url>
      <title>DEV Community: Maxim Cravtov</title>
      <link>https://dev.to/maxim_cravtov</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/maxim_cravtov"/>
    <language>en</language>
    <item>
      <title>How to Deploy SafeLine WAF on a Hestia Control Panel VPS</title>
      <dc:creator>Maxim Cravtov</dc:creator>
      <pubDate>Fri, 22 Aug 2025 06:38:31 +0000</pubDate>
      <link>https://dev.to/maxim_cravtov/how-to-deploy-safeline-waf-on-a-hestia-control-panel-vps-5f5o</link>
      <guid>https://dev.to/maxim_cravtov/how-to-deploy-safeline-waf-on-a-hestia-control-panel-vps-5f5o</guid>
      <description>&lt;p&gt;SafeLine is a powerful, self-hosted Web Application Firewall (WAF) that operates independently of specific control panels like Hestia Control Panel. This guide walks you through deploying SafeLine on a VPS that already runs Hestia Control Panel.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;⚠️ Disclaimer: SafeLine is not a native plugin for Hestia Control Panel. It must be deployed independently and configured to proxy traffic to your Hestia Control Panel-hosted sites. This guide assumes you are familiar with Linux server administration and Docker.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;A VPS&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Hestia Control Panel already installed&lt;/strong&gt; on the VPS and functional.&lt;br&gt;
&lt;strong&gt;Root or sudo access&lt;/strong&gt; to the VPS.&lt;br&gt;
&lt;strong&gt;CPU with SSSE3 instruction support&lt;/strong&gt; (required by SafeLine).&lt;br&gt;
&lt;strong&gt;Public IP address&lt;/strong&gt; or proper DNS pointing to the VPS.&lt;br&gt;
&lt;strong&gt;Docker&lt;/strong&gt; and &lt;strong&gt;Docker Compose&lt;/strong&gt; installed.&lt;/p&gt;

&lt;p&gt;Step-by-Step Deployment&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install Hestia Control Panel
We will use Ubuntu 24.04
To generate installation instruction you can visit official page - 
&lt;a href="https://hestiacp.com/install.html" rel="noopener noreferrer"&gt;Official Web Site&lt;/a&gt;
But I will use next commands
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;wget https://raw.githubusercontent.com/hestiacp/hestiacp/release/install/hst-install.sh
and bash hst-install.sh --multiphp '7.4,8.0,8.1,8.2,8.3,8.4' --named no --fail2ban no 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;(in my case i dont need DNS server and fail2ban service running also i would like to have diffirent version of php 7.4-8.3)&lt;/p&gt;

&lt;p&gt;During install you will be asked for a few questions like&lt;/p&gt;

&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;Please enter administrator username: (valid username)&lt;/li&gt;
&lt;li&gt;Please enter administrator password: (valid password)&lt;/li&gt;
&lt;li&gt;Please enter admin email address: (valid email where you will get CP notifications)&lt;/li&gt;
&lt;li&gt;Please enter FQDN hostname (and a hostname of your server)&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;Installation will take up to 10-15 minutes at the end VM will be rebooted&lt;/p&gt;

&lt;p&gt;After reboot login to your server via ssh and we need to edit a few settings before starting to install SafeLine WAF&lt;/p&gt;

&lt;p&gt;Open nginx folder embed &lt;strong&gt;/etc/nginx/conf.d/&lt;/strong&gt; here you will see config file with called &lt;strong&gt;ip_of_your_server.conf&lt;/strong&gt; open it and change ports &lt;strong&gt;80 and 443 to 7080 and 7443&lt;/strong&gt; restart nginx - &lt;strong&gt;service nginx restart&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;And finaly open - /usr/local/hestia/conf/hestia.conf and change&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PROXY_PORT='80'
PROXY_SSL_PORT='443'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;to&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PROXY_PORT='7080'
PROXY_SSL_PORT='7443'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This changes will allow to install unlimited number of Applications under Hestia Control Panel ready to be added to &lt;strong&gt;SafeLine WAF&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Now we are ready to install SafeLine WAF
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Install Docker in your system&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Add Docker's official GPG key:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add the repository to Apt sources:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
  $(. /etc/os-release &amp;amp;&amp;amp; echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list &amp;gt; /dev/null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and start docker&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;service docker start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  And now lets install SafeLine
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir -p "/data/safeline"
cd "/data/safeline"
cd "/data/safeline"
touch ".env"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Write the following content in the ".env" file&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SAFELINE_DIR=/data/safeline
IMAGE_TAG=latest
MGT_PORT=9443
POSTGRES_PASSWORD={postgres-password}
SUBNET_PREFIX=172.22.222
IMAGE_PREFIX=chaitin
ARCH_SUFFIX=
RELEASE=lts
REGION=-g
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;More detailed Guide - &lt;a href="https://docs.waf.chaitin.com/en/GetStarted/Deploy" rel="noopener noreferrer"&gt;Official Web Site&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now open Safeline webUI &lt;strong&gt;&lt;a href="https://serverIP:9443" rel="noopener noreferrer"&gt;https://serverIP:9443&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;
You will see a Software License agreement just - AGREE,START USING&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0ha8j0b3v2n67oo9o6mj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0ha8j0b3v2n67oo9o6mj.png" alt="agreement" width="800" height="734"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;To get login credentials execute next command from server shell&lt;br&gt;
&lt;/p&gt;


&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker exec safeline-mgt resetadmin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;you will get output example&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[INFO] Initial username：admin
[INFO] Initial password：YourPassword
[INFO] Done
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open Application section and click Add Aplication&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcbfog6szi5k0iydpt8hz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcbfog6szi5k0iydpt8hz.png" alt="application" width="800" height="204"&gt;&lt;/a&gt;&lt;br&gt;
In Domain section put your domain name&lt;br&gt;
Under SSL Cert press Add New cert (new tab will be opened)&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Press ADD CERT and upload your existing SSL cert or reques a free one by selecting get free cert&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3vers4v9gp61uq3hs357.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3vers4v9gp61uq3hs357.png" alt="ssl_cert" width="604" height="557"&gt;&lt;/a&gt;&lt;br&gt;
After adding you cert you can go back to previos screen with application under SSL cert section select your added ssl under upstren add &lt;strong&gt;http://$server_IP:7080&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi8xffhvg5omj4zwuacta.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi8xffhvg5omj4zwuacta.png" alt="add_application" width="647" height="767"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And now open your domain in browser and check how it works.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7701szrwh84px5ea3rl1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7701szrwh84px5ea3rl1.png" alt="working_check" width="800" height="302"&gt;&lt;/a&gt;&lt;br&gt;
You also can test WAF working state by sending a few test requests&lt;br&gt;
for ex.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Code Injection: https://$domain/?id=phpinfo();system('id') 
SQL Injection: https://$domain/?id=1+and+1=2+union+select+1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On this request you will get an Access Forbidden Page&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr6lgd6pzk9p72566sr9g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr6lgd6pzk9p72566sr9g.png" alt="Access_Forbidden" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Also this Attack test will be loged in SafeLine dashboard under &lt;strong&gt;Attack&lt;/strong&gt; section&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4v2cfhhx3uju98wmrolb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4v2cfhhx3uju98wmrolb.png" alt="attack" width="800" height="138"&gt;&lt;/a&gt;&lt;br&gt;
Also under main &lt;strong&gt;Statistic&lt;/strong&gt; section you can track all activiy stats in real time&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc3pmpvpiyq3racvamizx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc3pmpvpiyq3racvamizx.png" alt="Statisctic" width="800" height="204"&gt;&lt;/a&gt;&lt;br&gt;
Thats all.&lt;/p&gt;

&lt;p&gt;⸻&lt;/p&gt;

&lt;h2&gt;
  
  
  Considerations
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;SSL: SafeLine supports automatic HTTPS with Let’s Encrypt or uploading your own certificates.&lt;/li&gt;
&lt;li&gt;Rate Limiting, Bot Management, and Rules: All configurable in the SafeLine panel per application.&lt;/li&gt;
&lt;li&gt;Multiple Sites: You can create multiple “Applications” in SafeLine for each Hestia Control Panel-hosted website.
⸻&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Known Limitations
&lt;/h2&gt;

&lt;p&gt;Resource usage: Running both SafeLine and Hestia Control Panel on the same VPS requires sufficient CPU and memory.&lt;br&gt;
⸻&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Tips
&lt;/h2&gt;

&lt;p&gt;Backup your server before introducing new reverse proxy rules.&lt;br&gt;
You can test SafeLine with one non-critical domain before deploying site-wide.&lt;br&gt;
Monitor application logs via SafeLine UI to ensure normal access and protection are in place.&lt;br&gt;
⸻&lt;/p&gt;

&lt;h2&gt;
  
  
  Documentation &amp;amp; Support
&lt;/h2&gt;

&lt;p&gt;SafeLine Website: &lt;a href="https://ly.safepoint.cloud/ShZAy9x" rel="noopener noreferrer"&gt;https://ly.safepoint.cloud/ShZAy9x&lt;/a&gt;&lt;br&gt;
Official Docs: &lt;a href="https://docs.waf.chaitin.com/en/home" rel="noopener noreferrer"&gt;https://docs.waf.chaitin.com/en/home&lt;/a&gt;&lt;br&gt;
SafeLine Demo: &lt;a href="https://demo.waf.chaitin.com:9443" rel="noopener noreferrer"&gt;https://demo.waf.chaitin.com:9443&lt;/a&gt;&lt;br&gt;
Community Discord: &lt;a href="https://discord.gg/dy3JT7dkmY" rel="noopener noreferrer"&gt;https://discord.gg/dy3JT7dkmY&lt;/a&gt;&lt;br&gt;
⸻&lt;/p&gt;

&lt;p&gt;SafeLine is an excellent option for homelab users and developers who prefer full control and visibility over web application protection. While not tailor-made for Hestia Control Panel, it can be effectively deployed on the same VPS with careful configuration.&lt;/p&gt;

</description>
      <category>safeline</category>
      <category>hestiacp</category>
      <category>devops</category>
      <category>security</category>
    </item>
  </channel>
</rss>
