Sign In
Sign In

How to Protect a Server from DDoS Attacks

How to Protect a Server from DDoS Attacks
Hostman Team
Technical writer
Servers
03.12.2024
Reading time: 6 min

A DDoS attack (Distributed Denial of Service) aims to overwhelm a network with excessive traffic, reducing its performance or causing a complete outage. This is reflected in the term "denial-of-service" (refusal of service).

The frequency and intensity of DDoS attacks have been rising rapidly. A report by Cloudflare noted that in 2021, the number of attacks grew by one-third compared to 2020, with a peak in activity observed in December.

The duration of a DDoS attack can vary. According to research by Securelist:

  • 94.95% of attacks end within four hours.
  • 3.27% last between 5 to 9 hours.
  • 1.05% persist for 10 to 19 hours.
  • Only 0.73% of all attacks extend beyond 20 hours.

Effective Tools for Protecting a Server from DDoS Attacks

If you don't want to rely on vendors' solutions, paid services, or proprietary software, you can use the following tools to defend against DDoS attacks:

  1. IPTables. A powerful firewall tool available in Linux systems that allows precise control over incoming and outgoing traffic.
  2. CSF (ConfigServer Security and Firewall). A robust security tool that simplifies managing firewall rules and provides additional protection mechanisms.
  3. Nginx Modules. Modules specifically designed for mitigating DDoS attacks, such as limiting the number of requests per IP or delaying excessive requests.
  4. Software Filters. Tools or scripts that analyze and filter traffic to block malicious or excessive requests, helping to maintain service availability.

IPTables. Blocking Bots by IP Address

The IPTables tool helps protect a cloud server from basic DDoS attacks. Its primary function is to filter incoming traffic through special tables. The resource owner can add custom tables.

Each table contains a set of rules that govern the tool's behavior in specific situations. By default, there are only two response options: ACCEPT (allow access) and REJECT (block access).

In IPTables, it is possible to limit the number of connections.  If a single IP address exceeds the allowed number of connections, the tool will block access for that IP. You can extend the tool's functionality with additional criteria:

  • Limit: Sets a limit on the number of packet connections within a chosen time period.
  • Hashlimit: Works similarly to Limit, but applies to groups of hosts, subnets, and ports.
  • Mark: Used to mark packets, limit traffic, and filter.
  • Connlimit: Limits the number of simultaneous connections for a single IP address or subnet.
  • IPRange: Defines a range of IP addresses that are not considered as a subnet by the tool.

Additionally, IPTables can use criteria such as Owner, State, TOS, TTL, and Unclean Match to set personalized configurations, effectively protecting the resource from DDoS attacks.

The ipset kernel module allows you to create a list of addresses that exceed the specified connection limit. The ipset timeout parameter sets a time limit for the created list, which is enough to ride out a DDoS attack.

By default, IPTables settings return to their basic configuration after a system reboot. To save the settings, you can use additional utilities (such as iptables-save or iptables-persistent), but it is recommended to start with the default options to avoid saving incorrect settings that could block server access for everyone.

ConfigServer Security and Firewall

While IPTables is a convenient and effective tool, it can be quite complex to configure. You’ll need to learn how to manage it and write additional scripts, and if something goes wrong, your resource may end up being a "closed club" for just a few users.

CSF (ConfigServer Security and Firewall) is a "turnkey" configurator, meaning you only need to set the correct parameters and not worry about the server's security.

Installing the Server Firewall

The preliminary installation steps involve downloading two additional components required to run CSF: the Perl interpreter and the libwww library. The next step is to install ConfigServer Security and Firewall itself. Since the tool is not available in the official repository, you'll need to download it directly from the provided link or by fetching the ready-made archive:

cd /usr/src
wget https://download.configserver.com/csf.tgz

After downloading, extract the archive and move it to the defender’s files folder. Then, run the installation process. Once installed successfully, you can proceed with configuring CSF.

Configuring the Server Firewall

By default, the settings in ConfigServer and Firewall are active for 5 minutes, after which any changes are reset. This test format is useful for conducting experiments and understanding errors in the applied configuration. To switch to live mode, change the Testing value to 0.

Proper configuration of CSF ensures reliable protection against DDoS attacks. Here are some essential commands in CSF:

Specify incoming ports:

TCP_IN = "22,23,25,36,75,87"

Specify outgoing ports:

TCP_OUT = "22,23,25,36,75,87"

Configure email notifications for SSH connections:

LF_SSH_EMAIL_ALERT = "1"

Add an IP address to the exception list (useful for server management teams):

csf -a 192.168.0.7

Block a specific IP address from connecting to the server:

csf -d 192.168.0.6

Nginx Modules

How can you protect your server from DDoS attacks using simpler methods? Use Nginx modules like limit_conn and limit_req. The limit_conn module limits the maximum number of connections to the server, while the limit_req module limits the number of requests within a specified time frame.

For example, if you want to limit the number of simultaneous connections to 30 and restrict the number of connections within a 3-second window, the configuration will look as follows:

limit_conn_zone $binary_remote_addr zone=perip: 30m;
limit_req_zone $binary_remote_addr zone=dynamic:30m rate=3r/s;

This configuration allows only 3 requests per second. Any additional requests are queued. The burst parameter controls the queue size. For example, if the burst value is set to 7, the module will queue up to 7 requests when the request count exceeds 10, while any further requests will be rejected with an error.

Software Filter

Server protection against DDoS attacks can also be achieved using web applications. A traffic filter uses JavaScript, which is inaccessible to bots, effectively redirecting DDoS attacks to a placeholder page.

The operation of the filter is simple. The configuration defines conditions for blocking bots, and when a visitor meets those conditions, they are redirected to a placeholder page instead of the requested page. The filter can also specify the reason for the redirection.

Servers
03.12.2024
Reading time: 6 min

Similar

Servers

Setting Up NTP on a Server: A Step-by-Step Guide

NTP (Network Time Protocol) is used to synchronize system time with a reference time provided by special servers. This article will cover how to configure NTP on various operating systems and devices, starting with a comprehensive guide on setting up an NTP Server on Linux. Choose your server now! Configuring an NTP Server on Linux We'll demonstrate synchronization setup using Ubuntu, but this guide also applies to Debian and most Linux-based systems. We’ve divided the instructions into three parts: the first covers installing the NTP server, the second explains synchronizing NTP clients, and the third covers advanced synchronization settings. To follow this guide, you will need: A cloud server with Ubuntu installed A root user or a user with sudo privileges nano or any other editor installed Installing the NTP Server These steps will guide you through installing and preparing the NTP server for further configuration. Update the repository index to ensure you can download the latest software versions. Use the following command: sudo apt-get update Install the NTP server: sudo apt-get install ntp Confirm the installation by choosing Y if prompted (Y/N). Wait until the software is downloaded and installed. Verify the installation: sntp --version The output should display the version number and the installation time. Switch to the nearest server pool. The server should receive accurate time by default, but it’s better to connect to a server pool closest to your location for extra reliability. To do this, edit the ntp.conf file located at /etc/ntp.conf. Open it with nano (you need sudo privileges) by entering: sudo nano /etc/ntp.conf You’ll see four lines, which we’ve highlighted in orange for reference: These are the default pools, which we’ll replace with local ones (for example, for the USA, we can use NTP servers from this page). After replacing the lines, save and close ntp.conf by pressing Ctrl+O and Ctrl+X. Restart the server: sudo service ntp restart Check the server status: sudo service ntp status The output should indicate Active (running) on one of the first lines (Active) and the server start time. Configure the firewall. To allow client access to the server, open UDP port 123 using UFW with the following command: sudo ufw allow from any to any port 123 proto udp The installation is complete, and the server is running; now, you can proceed with further configuration. Configuring NTP Client Synchronization The following steps will allow client systems to synchronize with our NTP server, which will serve as their primary time source. Check the Connection To verify the network configuration for NTP, enter the following command in the terminal: sudo apt-get install ntpdate Specify IP Address and Hostname To configure the server’s IP and hostname, edit the hosts file located at /etc/hosts: sudo nano /etc/hosts Add the relevant data in the third line from the top (the address below is just an example; replace it with the actual IP of your NTP server): 192.168.154.142 ntp-server Press Ctrl+X to exit and save changes by pressing Y. Alternatively, if you have a DNS server, you can perform this step there. Verify Client Synchronization with the Server To check if synchronization is active between the server and client, enter: sudo ntpdate ntp-server The output will show the time offset. A few milliseconds difference is normal, so you can ignore small values. Disable the timesyncd Service This service synchronizes the local system time, but we don't need it since our clients will sync with the NTP server. Disable it with: sudo timedatectl set-ntp off Install NTP on the Client System Install NTP on the client with this command: sudo apt-get install ntp Set Your NTP Server as the Primary Reference To ensure clients sync specifically with your server, open the ntp.conf file and add the following line: server NTP-server-host prefer iburst The prefer directive marks the server as preferred, and iburst allows multiple requests to the server for higher synchronization accuracy. Save the changes by pressing Ctrl+X and confirming with Y. Restart the Server Restart the NTP server with this straightforward command: sudo service ntp restart Check the Synchronization Queue Finally, check the synchronization status by entering: ntpq -ps This command displays the list of servers in the synchronization queue, including your NTP server as the designated source. Advanced Synchronization Options Now that we’ve set up the NTP server and synchronized client machines, we’ll revisit the ntp.conf file (located at /etc/ntp.conf), which contains additional configurations to ensure robust synchronization with external sources. Preferred Server Mark the most reliable server or server pool with the prefer directive we’ve used before. For example: server 1.north-america.pool.ntp.org prefer The server directive indicates a specific server, while pool can be used to specify a pool of servers. Don’t forget the line server 127.127.1.0 at the end of the pool list, which defaults to the system time if the connection is lost. Security Settings Make sure the following lines are included in ntp.conf: restrict default kod notrap nomodify nopeer noquery The default command applies these settings as defaults for all restrict commands: kod (Kiss-o’-Death) limits the rate of requests. notrap blocks the acceptance of control commands. nomodify restricts commands that might alter the server state. nopeer prohibits synchronization with external hosts. noquery blocks query requests. For IPv4, use -4 before default, and for IPv6, use -6. Here’s an example of using some of these commands. The following line allows synchronization of nodes in a specific network while restricting nodes from receiving control or state-altering commands: restrict 192.168.0.0 mask 255.255.255.0 nomodify notrap The following lines are required for the server to communicate with itself: restrict 127.0.0.1restrict ::1 Finally, remember to restart the server after making these changes. Verifying NTP Operation To check if NTP is functioning correctly, use the command ntpq -p. Example output: In the first column, you’ll see the synchronization server’s address, followed by its parent server, stratum level (st column), and nup (t column). The next three columns show details on the last synchronization time, sync interval, and reliability status . The final two columns display the time difference between the synchronized server and the reference server, as well as the offset. Pay attention to the symbols in the first column, which appear before the IP address: A + symbol indicates a reliable server for synchronization and a - means the opposite. An * indicates the current server chosen for synchronization. Occasionally, an x will appear, which means the server is unavailable. Checking if the Server Provides Accurate Time To ensure the server is distributing the correct time, run the ntpdate command from another system, specifying the IP address of the NTP server you want to verify. The output should look something like this: adjust time server (IP address here) offset 0.012319 sec The number represents the time offset. Here, an offset of about 0.01 seconds (12 milliseconds) is perfectly acceptable. Now that we’ve completed the Linux setup, let’s look at configuring the NTP protocol on Windows. Configuring an NTP Server on Windows Server To install and configure an NTP server on Windows Server, you'll need to make some changes in the registry and run commands in the command prompt.  Before proceeding with the configuration, you must start the service. This is done by modifying the following registry entry: HKLM\System\CurrentControlSet\services\W32Time\TimeProviders\NtpServer In this section, find the Enabled entry on the right and set it to 1 so that the Data column displays: 0x00000001 (1) Next, open cmd and enter the command needed to restart the protocol: net stop w32time && net start w32time Make sure to run this command from C:\Users\Administrator. To verify that NTP is enabled, use the following command: w32tm /query /configuration You’ll get a long entry, and you should check the block NtpServer <Local>. In the Enabled line, the value should be 1. Now, open UDP port 123 in the firewall for proper client servicing, and then proceed with the configuration. Return to the registry and look for the entry: HKLM\System\CurrentControlSet\services\W32Time\Parameters This section contains many parameters, but the main one is Type, which can take one of four values: NoSync — No synchronization. NTP — Synchronization with external servers specified in the NtpServer registry entry (this is the default for standalone machines). NT5DS — Synchronization according to the domain hierarchy (default for machines in a domain). AllSync — Synchronization with all available servers. Now, go back to the registry and configure the values under the NtpServer section. Most likely, only the Microsoft server is listed. You can add others, paying attention to the flag at the end: 0x1, SpecialInterval — Standard mode recommended by Microsoft. 0x2, UseAsFallbackOnly — Use this server as a fallback. 0x4, SymmetricActive — This is the main mode for NTP servers. 0x8, Client — Used when synchronization issues occur. The last thing you need to do is set the synchronization interval in the section: W32Time\TimeProviders\NtpClient The parameter is SpecialPollInterval, where you should set the desired value (in seconds). By default, it’s set to one week. If you want more frequent synchronization, set: 86400 for 1 day. 21600 for a quarter of a day (6 hours). 3600 for 1 hour. The last value is optimal in terms of system load and acceptable precision when frequent synchronization is required. Configuring an NTP Server on Cisco Devices On Cisco devices, the process is simple and quick: Enter configuration mode with the command: conf t Set the time zone using the command: clock timezone <timezone> <offset> For example: clock timezone CST -6 Next, enter the command to set the NTP source: ntp source Specify the source. If you want to make the server the primary one for other machines in the network, use the following command: ntp master 2 The number should be 2 or greater. Use the command ntp update-calendar to update the time. Enter the names or IP addresses of the NTP servers. Enter the time zone with the command: clock timezone And set the source using: ntp source To check the configuration or troubleshoot, use the show command. It will be useful for checking the time (show clock), NTP status (show ntp status), and associations (show ntp associations). Choose your server now! Configuring an NTP Server on MikroTik Routers We will configure the NTP server using SNTP: In Winbox, go to System – SNTP Client. Find the SNTP Client section and enable it by checking the Enabled box. In the Server DNS Names field below, enter the IP addresses of the NTP servers. To check if everything is working, go to System – Clock. Set the time zone by choosing it from the dropdown list or check the Time Zone Autodetect box, and the time zone will be set automatically. The synchronization interval can be seen in the Poll Interval field in the SNTP Client menu. Below, you will find the last synchronization time in the Last Update field. That’s it! Now you’ve learned how to configure NTP on different operating systems and devices. Frequently Asked Questions (FAQ) What is NTP and why is it important?  NTP (Network Time Protocol) is used to synchronize the clocks of computers over a network. Accurate time is critical for log file timestamps, database replication consistency, and security protocols like Kerberos. How to configure NTP Server in Windows Server 2019?  The most reliable method is using the Command Prompt (Admin) or PowerShell. Enable the NTP service: w32tm /config /syncfromflags:manual /manualpeerlist:"0.pool.ntp.org 1.pool.ntp.org" /reliable:yes /update Restart the Time Service: net stop w32time && net start w32time Verify configuration: w32tm /query /configuration How to configure NTP server in Linux?  Most modern Linux distributions (Ubuntu 20.04+, CentOS 8+) use Chrony by default, while older ones use the ntp daemon. For Chrony: Edit /etc/chrony.conf. Add server lines like server 0.pool.ntp.org iburst. Restart with sudo systemctl restart chronyd. For NTPd: Edit /etc/ntp.conf. Add server 0.pool.ntp.org. Restart with sudo systemctl restart ntp. What port does NTP use?  NTP uses UDP port 123. You must ensure this port is open on your firewall (UFW, iptables, or Windows Firewall) for the server to send and receive time updates. How do I check if my Linux server is synchronized? If using Chrony: Run chronyc sources. Look for lines starting with * (current source) or + (candidate). If using NTP: Run ntpq -p. The row starting with * indicates the active time source. What is an NTP Stratum?  The Stratum level indicates the distance from the original reference clock. Stratum 0: Atomic clocks or GPS (not directly on the network). Stratum 1: Computers directly connected to Stratum 0 devices. Stratum 2: Computers that sync with Stratum 1 servers. Lower numbers mean higher accuracy.
22 January 2026 · 11 min to read
Ubuntu

How to Install VNC on Ubuntu

If you need to interact with a remote server through a graphical interface, you can use VNC technology.Through a network, users can connect remotely to a server using VNC (Virtual Network Computing). It employs the RFB protocol to send screen images and input data from different devices (such keyboards and mice) and runs on a client-server architecture. Ubuntu, Windows, macOS, and other operating systems are among those that VNC supports. The ability to connect several users at once is another benefit of VNC, which can be helpful for group tasks or training sessions. Choose your server now! And if you’re looking for a reliable, high-performance, and budget-friendly solution for your workflows, Hostman has you covered with Linux VPS Hosting options, including Debian VPS, Ubuntu VPS, and VPS CentOS. In this guide, we will describe how to install VNC on Ubuntu, using a Hostman cloud server with Ubuntu 22.04 as an example. Finished installation of VNC on Ubuntu Step 1: Preparing to Install VNC Before starting the installation process on both the server and the local machine, there are a few prerequisites to review.  Here is a list of what you’ll need to complete the installation: A Server Running Ubuntu 22.04. In this guide, we will use a cloud server from Hostman with minimal hardware configuration. Hostman's plan selection in admin panel A User with sudo Privileges. You should perform the installation as a regular user with administrative privileges. Select a Graphical Interface. You’ll need to choose a desktop environment that you will use to interact with the remote server after installing the system on both the server and the local machine. A Computer with a VNC Client Installed.  At the moment, the console is the sole method of communication with a rented server running Ubuntu 22.04. You must install a desktop environment and VNC on the server in order to enable remote management through a graphical interface. The desktop environments and VNC servers that are compatible with Ubuntu servers are listed below. VNC Servers: TightVNC Server. One of the most popular VNC servers for Ubuntu. It is easy to set up and offers good performance. RealVNC Server. RealVNC provides a commercial solution for remote access to servers across various Linux distributions, including Ubuntu, Debian, Fedora, Arch Linux, and others. Desktop Environments: Xfce. A lightweight and fast desktop environment, ideal for remote sessions over VNC. It uses fewer resources than heavier desktop environments, making it an excellent choice for servers and virtual machines. GNOME. The default Ubuntu desktop environment, offering a modern and user-friendly interface. It can be used with VNC but will consume more resources than Xfce. KDE Plasma. Another popular desktop environment that provides a wide range of features and a beautiful design. The choice of VNC server and desktop environment depends on the user’s specific needs and available resources. TightVNC and Xfce are excellent options for stable remote sessions on Ubuntu, as they do not require high resources. In the next step, we will describe how to install them on the server in detail. Step 2: Installing the Desktop Environment and VNC Server To install the VNC server on Ubuntu along with the desktop environment, connect to the server and log in as a regular user with administrative rights. Update the Package List  After logging into the server, run the following command to update the packages from the connected repositories: sudo apt update Install the Desktop Environment  Next, install the previously selected desktop environment. To install Xfce, enter: sudo apt install xfce4 xfce4-goodies Here, the first package provides the basic Xfce desktop environment, while the second includes additional applications and plugins for Xfce, which are optional. Install the TightVNC Server  To install TightVNC, enter: sudo apt install tightvncserver Start the VNC Server  Once the installation is complete, initialize the VNC server by typing: vncserver This command creates a new VNC session with a specific session number, such as :1 for the first session, :2 for the second, and so on. This session number corresponds to a display port (for example, port 5901 corresponds to :1). This allows multiple VNC sessions to run on the same machine, each using a different display port. This command will ask you to create a password during the initial setup, which is necessary for users to access the server's graphical user interface. Don't forget to verify your password to run VNC on Ubuntu Set the View-Only Password (Optional)  After setting the main password, you’ll be prompted to set a password for view-only mode. View-only mode allows users to view the remote desktop without making any changes, which is helpful for demonstrations or when limited access is needed. If you need to change the passwords set above, use the following command: vncpasswd Now you have a VNC session. VNC on Ubuntu is running In the next step, we will set up VNC to launch the Ubuntu server with the installed desktop environment. Step 3: Configuring the VNC Server The VNC server needs to know which desktop environment it should connect to. To set this up, we’ll need to edit a specific configuration file. Stop Active VNC Instances  Before making any configurations, stop any active VNC server instances. In this guide, we’ll stop the instance running on display port 5901. To do this, enter: vncserver -kill :1 Simple command to stop VNC running on Ubuntu Here, :1 is the session number associated with display port 5901, which we want to stop. Create a Backup of the Configuration File  Before editing, it’s a good idea to back up the original configuration file. Run: mv ~/.vnc/xstartup ~/.vnc/xstartup.bak Edit the Configuration File  Now, open the configuration file in a text editor: nano ~/.vnc/xstartup Replace the contents with the following: #!/bin/bashxrdb $HOME/.Xresourcesstartxfce4 & #!/bin/bash: This line is called a "shebang," and it specifies that the script should be executed using the Bash shell. xrdb $HOME/.Xresources: This line reads settings from the .Xresources file, where desktop preferences like colors, fonts, cursors, and keyboard options are stored. startxfce4 &: This line starts the Xfce desktop environment on the server. Make the Configuration File Executable To allow the configuration file to be executed, use: chmod +x ~/.vnc/xstartup Start the VNC Server with Localhost Restriction Now that the configuration is updated, start the VNC server with the following command: vncserver -localhost The -localhost option restricts connections to the VNC server to the local host (the server itself), preventing remote connections from other machines. You will still be able to connect from your computer, as we’ll set up an SSH tunnel between it and the server. These connections will also be treated as local by the VNC server. The VNC server configuration is now complete. Step 4: Installing the VNC Client and Connecting to the Server Now, let’s proceed with installing a VNC client. In this example, we’ll install the client on a Windows 11 computer. Several VNC clients support different operating systems. Here are a few options:  RealVNC Viewer. The official client from RealVNC, compatible with Windows, macOS, and Linux. TightVNC Viewer. A free and straightforward VNC client that supports Windows and Linux. UltraVNC. Another free VNC client for Windows with advanced remote management features. For this guide, we’ll use the free TightVNC Viewer. Download and Install TightVNC Viewer Visit the official TightVNC website, download the installer, and run it. Download VNC from official website In the installation window, click Next and accept the license agreement. Then, select the custom installation mode and disable the VNC server installation, as shown in the image below. This is what you need to install Click Next twice and complete the installation of the VNC client on your local machine. Set Up an SSH Tunnel for Secure Connection To encrypt your remote access to the VNC server, use SSH to create a secure tunnel. On your Windows 11 computer, open PowerShell and enter the following command: ssh -L 56789:localhost:5901 -C -N -l username server_IP_address Make sure that OpenSSH is installed on your local machine; if not, refer to Microsoft’s documentation to install it. This command configures an SSH tunnel that forwards the connection from your local computer to the remote server over a secure connection, making VNC believe the connection originates from the server itself. Here’s a breakdown of the flags used: -L sets up SSH port forwarding, redirecting the local computer’s port to the specified host and server port. Here, we choose port 56789 because it is not bound to any service. -C enables compression of data before transmitting over SSH. -N tells SSH not to execute any commands after establishing the connection. -l specifies the username for connecting to the server. Connect with TightVNC Viewer After creating the SSH tunnel, open the TightVNC Viewer and enter the following in the connection field: localhost:56789 You’ll be prompted to enter the password created during the initial setup of the VNC server. Once you enter the password, you’ll be connected to the VNC server, and the Xfce desktop environment should appear. Stop the SSH Tunnel To close the SSH tunnel, return to the PowerShell or command line on your local computer and press CTRL+C. You found out how to install VNC on Ubuntu Conclusion This guide has walked you through the step-by-step process of setting up VNC on Ubuntu 22.04. We used TightVNC Server as the VNC server, TightVNC Viewer as the client, and Xfce as the desktop environment for user interaction with the server. We hope that using VNC technology helps streamline your server administration, making the process easier and more efficient. We're prepared more detailed instruction on how to create server on Ubuntu if you have some trouble deploying it. Or you can use our low-latency US based VPS! Choose your server now! Frequently Asked Questions (FAQ) How to install VNC server on Ubuntu via command line?  The most common lightweight server is TightVNC. To install it, open your terminal and run: Update lists: sudo apt update Install the package: sudo apt install tightvncserver Initialize it (and set a password) by running: vncserver How do I uninstall VNC server on Ubuntu?  To remove the software and your configuration files, follow these steps: Stop the VNC session: vncserver -kill :1 Remove the package: sudo apt remove tightvncserver --purge (Optional) Delete config files: rm -rf ~/.vnc Is VNC secure?  By default, no. VNC traffic is not encrypted, meaning passwords and keystrokes can be intercepted. It is highly recommended to tunnel your VNC connection through SSH rather than opening the VNC port (5901) directly to the internet. Why do I see a gray screen when I connect?  This "gray screen of death" usually means the VNC server doesn't know which desktop environment to load. You need to edit the ~/.vnc/xstartup file and add the command for your desktop (e.g., startxfce4 & for XFCE or gnome-session & for GNOME). Which port does VNC use?  VNC uses port 5900 + Display ID. Display :1 uses port 5901. Display :2 uses port 5902. You must ensure these ports are allowed on your firewall if you are not using an SSH tunnel. What is the difference between TigerVNC, RealVNC, and TightVNC? TightVNC: Lightweight, reliable, and great for slower connections. Very popular for Linux. TigerVNC: A high-performance fork of TightVNC, often faster on modern hardware. RealVNC: Often proprietary/commercial, offers cloud connectivity but is less common for open-source self-hosting.
21 January 2026 · 10 min to read
Servers

How to Migrate From Zapier to n8n and Organize n8n Workflows

Automation means setting up processes so that they run without manual intervention. Instead of copying data, sending notifications, or checking reports every day, you create a scenario once—and the system does everything automatically: quickly, accurately, and on schedule. For example: a form submission is sent to Telegram and the CRM; an order automatically turns into an invoice; every morning, a fresh report from Google Sheets is delivered to the chat; if a service fails, the team receives a log and a notification. Such scenarios eliminate routine errors, save time, and make processes more reliable. Increasingly, they are built not by developers but by product managers, marketers, and operations managers, through no-code tools like Zapier. However, this simplicity comes at a cost: strict limits, dependence on the cloud, paid integrations, and limited flexibility. That’s why many people are looking for a Zapier alternative, just as convenient, but more transparent and autonomous. One of the most popular alternatives is n8n, an open-source tool that can be deployed on your own cloud server. Why Zapier Stops Being Enough and How n8n Helps Zapier has become the automation standard for small and medium-sized businesses. It has a simple interface, ready-made integrations, and triggers and actions that can be set up in a couple of clicks. But as your tasks grow, you start to encounter limitations that no one thinks about at first. First, strict limits. A form submission, a date filter, and a table entry already count as three tasks. You can easily reach hundreds per month, and with CRM or email campaigns, thousands.The basic plan runs out quickly, and the next tiers cost $49, then $69, then $299—and even then, the limits remain. Second, dependence on the cloud. Your entire business logic lives on Zapier’s servers. If the service goes down, nothing works. If the pricing or terms change, you have to accept them. Third, a closed architecture. Requesting an external API with authorization, writing a filter in JavaScript, or creating a universal error handler is either impossible, available only on Pro accounts, or heavily restricted in the free plan. n8n solves these problems. You install the platform on your own server. Unlike Zapier, there are no limits on the number of tasks, executions, or workflows. It supports more than 400 integrations, and if needed, you can connect any API or write your own logic. For that, there’s a built-in Code Node, where you can use JavaScript or Python directly within a workflow. At the same time, the interface remains visual and user-friendly, just like Zapier, but with more flexibility and control. n8n isn’t just for developers. The interface is intuitive for anyone who has ever built a Zapier flow. And if necessary, you can always bring in a developer to add a node, custom module, or code snippet. In essence, n8n is the same kind of builder, just without restrictions and hosted on your own server. You decide where your workflows are stored, who has access, how logs are managed, and when updates happen. No subscription fees, no external rules. In summary, the n8n vs. Zapier comparison looks like this: Criterion Zapier n8n (self-hosted) Cost From $19.99/month and up, depending on the number of tasks The software itself is free; you only pay for the server Limits Limits on tasks, steps, and run frequency No limits: run as many tasks as your server can handle Where it runs Only in Zapier’s cloud On your own server, in the cloud, or locally Data control All workflows and tokens are stored by Zapier Full control. Everything stays with you Access to logic Only what’s allowed (limited feature set) You can write scripts in JavaScript and Python, and connect any API Interface Visual, simple Also visual Workflow flexibility Simple linear flow Conditions, branches, loops, sub-workflows Updates and support Only from Zapier, on their schedule Update when you want; community support available Entry barrier Minimal, no technical skills required Requires some admin skills to install and set up Zapier on your server  Scalability Limited by your plan You can add queues and scale workers How to Migrate Workflows from Zapier to n8n If you’ve used Zapier before, you probably already have workflows. Migrating them manually may seem tedious, but in practice, it’s much simpler: many chains in n8n can be built more clearly and flexibly. The key is to approach migration step by step. Step 1. Analyze your current Zaps Before starting the migration, make a list of all active workflows: Which ones run daily or on a schedule? Which involve external services (Gmail, Telegram, Google Sheets)? Which have many steps and complex logic? It’s helpful to create a priority table: note which workflows must be migrated first, which can wait, and which can be removed entirely. Step 2. Determine what can be transferred directly Many workflows from Zapier can be recreated in n8n almost identically: webhook → filter → API request on schedule → fetch records from Airtable → write to table email received → extract data → send to Notion If the chain is simple, you can rebuild it in n8n in about 10–15 minutes. Nodes in the editor visually resemble Zapier steps: settings on the right, inputs and outputs on the left. Everything feels familiar. Step 3. Where manual adjustments are needed Some things in Zapier are handled automatically, such as date formatting or filtering. In n8n, you need to configure them explicitly through separate nodes (IF, Set, or Function). However, this gives you full control. Examples: In Zapier: a filter for “amount > 1000” takes one line. In n8n: you set up the condition manually in an IF node. The advantage is that in n8n you can use variables, combine conditions, work with nested JSON structures, and create branches. Step 4. Import JSON from Zapier (if available) Some Zaps can be exported as JSON using Zapier CLI or Zapier Transfer. There’s no direct import feature in n8n, but you can open the exported structure, copy URLs, fields, and steps, and recreate them manually. This process is faster than it sounds, especially once you understand the structure. Step 5. Test and enable n8n lets you run each step of a workflow individually. This is convenient because: You can see the input and output data at each stage. You can debug faulty branches separately. There’s a built-in log for all runs. After configuration, make sure the workflow runs stably. Then connect real webhooks, enable the schedule, and delete the old Zap. How to Organize Workflows in n8n: Tips for Usability and Reliability Give Nodes Meaningful Names By default, each node is named after its type, for example, HTTP Request or IF. If your workflow has ten such nodes in a row, it’s hard to navigate. Rename them: “Request to CRM,” “Filter by Status,” “Send to Telegram.” This will especially help when you revisit the workflow later. Use Color Coding In n8n, you can highlight nodes with colors. It doesn’t affect execution but makes the structure easier to read: Incoming data: blue Logic or conditions: yellow External APIs: red Final actions: green On large workflows, this really saves time. Split Workflows into Multiple Entities In n8n, there are workflows and subworkflows.The latter don’t trigger on their own; they’re used only within other workflows. n8n includes a special node, Execute Workflow, which allows you to call one workflow from another. If a single workflow grows too large, break it into parts. This approach has several advantages: You can reuse common actions, such as error logging. The main workflow stays compact. Changes in a subworkflow don’t break logic elsewhere. Use the Code node for Complex Transformations When you need to filter an array, extract a field from a nested object, or calculate a date difference, it’s often easier to use the Code node and write a few lines of JavaScript instead of building a long chain of Set + IF + Merge nodes. Example: // Keep only orders greater than 1000 return items.filter(item => item.json.total > 1000); To add this node, search for “Code” in the editor and select the first result. Enable Queue Mode if You Expect a Heavy Load By default, n8n runs all workflows in a single process. That’s fine for 10–20 executions a day. But if your workflows run more than 100 times per hour, it’s recommended to enable queue mode. This allows you to distribute tasks among multiple worker nodes and process them in parallel. You can find more details in the n8n documentation. It’s an advanced feature, but the docs include ready-made examples. Don’t Forget try/catch and fallback External APIs may be unavailable, or a server may return a 500 error. A failure in one step shouldn’t break the entire workflow. Add status checks, use IF and Set nodes with default values, and in extreme cases, send a notification to Telegram or write to a log. Common Migration Errors and How to Fix Them The cases in the table below are the most common. By fixing them early, you’ll avoid 80% of typical issues when migrating to n8n. Symptom Problem Solution After restarting the container, some workflows disappear Workflows were stored in SQLite inside the container without a persistent volume; the database reverted on stop Mount a volume to /home/node/.n8n or use PostgreSQL/MySQL right away. More details are available in the n8n community. You can also set up regular data backups. The server crashes with 502 or “out of memory” when processing thousands of records The workflow processes the entire array at once, and RAM runs out Split data with SplitInBatches, use a subworkflow or a queue, and increase RAM on the host if needed Logs fill up with “Redis unavailable – trying to reconnect…” and n8n shuts down Incorrect environment variables for queue mode; the service can’t reach Redis Set QUEUE_BULL_REDIS_HOST=redis (or the correct host) and check your Docker Compose or K8s network Webhooks return 404/502 behind Nginx or Traefik WEBHOOK_URL or N8N_HOST contain an incorrect path or missing protocol; URL doesn’t match proxy Set WEBHOOK_URL=https://example.com (without /webhook), restart n8n and the proxy Workflow stops on the first failed request and you find out by accident No error handler; workflow is purely linear without an Error Workflow Add a global Error Workflow, catch errors with the Error Trigger node, send alerts, and write logs Where to Learn n8n and What to Explore Next If you’re just starting with n8n, you don’t need to master every detail manually. The platform has an excellent community and dozens of resources to help you get up to speed, from your first workflow to advanced setups with queues, databases, and authentication. Here’s where to begin: Official Documentation. A clear structure with examples for every node, explanations of variables, queues, and storage. There are even ready-made YAML files for running n8n in Docker or Kubernetes. n8n YouTube Channel. Short, easy-to-follow videos demonstrating how to build workflows, from simple ones (Telegram bots, forms, Airtable) to complex ones (API requests, array processing, conditional transitions). Community Forum. The real knowledge hub for n8n. You can ask any question and almost always get an answer from developers or experienced users. You’ll also find workflow examples, unconventional solutions, and architecture advice there. Node and Template Marketplace. A collection of all available integrations: more than 400 services, from popular ones (Telegram, Gmail, Slack, Notion) to more niche ones. You can instantly install needed nodes or browse ready-made workflow templates. Should You Switch to n8n? Who Benefits Most n8n isn’t universal. It’s a powerful tool, but not for everyone. Before abandoning Zapier, evaluate your team’s needs, skills, and budget realistically. The switch almost always makes sense if: You’re paying more than $50 a month for Zapier. One or two workflows with frequent triggers can already exceed the basic plan. n8n gives you the same functionality with no subscription fees. You have more than 5–10 active Zaps. If automation is core to your operations (leads, orders, reports, notifications), migration provides both cost savings and greater flexibility. You’ve outgrown Zapier’s features. Need to connect a custom API, handle JSON, or add JavaScript? In Zapier, this is either impossible or expensive. In n8n, it’s built in. You want to store your data locally. For personal data, tokens, or orders, a self-hosted solution is safer and more controllable. You have basic technical skills or developer support. Even with a visual interface, production setups require some DevOps knowledge: domain configuration, volumes, and backups. You might want to stay on Zapier if: You have only one or two simple workflows and fit within the free or lowest-paid plan. You don’t want to deal with setup or updates. You just need to quickly test an idea rather than build an infrastructure. If automation is a key part of your processes rather than a casual experiment, switching to n8n gives you more control, flexibility, and predictability. Yes, it takes a bit more attention, but the result is worth it.
06 October 2025 · 11 min to read

Do you have questions,
comments, or concerns?

Our professionals are available to assist you at any moment,
whether you need help or are just unsure of where to start.
Email us
Hostman's Support