Dec 24, 2025
Aris S.
15min Read
Automating Hostinger virtual private server (VPS) management using n8n and our public API helps streamline repetitive tasks, such as monitoring uptime and sending alerts on Slack. In addition to making the task more efficient, it reduces human errors and enables you to focus on crucial tasks that require more complex configurations, like fine-tuning firewall rules.
You can accomplish this using two key tools: n8n, a powerful open-source low-code automation platform, and the Hostinger API, which provides the programmatic interface to manage your servers, in this case through n8n. The process of automating your VPS tasks with these tools is straightforward:
Examples of simple tasks that can be automated using n8n and the Hostinger API include alerting you to downtime, logging the latest backup for historical data, notifying you of potentially compromised VPS, and creating Jira tickets for traffic spikes.
Before diving into building these workflows, let’s explore the basics by understanding the tools that make this automation possible.
VPS management involves overseeing and maintaining the performance, security, software, and system updates of a virtual server. It includes tasks such as configuring server settings, monitoring uptime, managing storage and backups, and applying security patches.
Proper VPS management is essential to ensure smooth, reliable, and secure operations. However, it can be time-consuming, repetitive, and prone to human error – especially as you add more servers.
Automating VPS management can streamline routine tasks, reduce risk, and free up time for more strategic work, among other benefits.
Automating your VPS management tasks with n8n and the Hostinger API delivers various benefits that extend beyond simple efficiency, impacting reliability, consistency, and resource allocation.
Automating Hostinger VPS management requires two tools: n8n and our public API.
n8n runs the workflow for automating the task, while the API facilitates the communication between the automation platform and your VPS.
n8n is an open-source platform that lets you automate various tasks by connecting different applications and setting custom logic to manipulate data as it moves.
In automated VPS management, n8n fetches data from your VPS via API, filters it according to specific rules, and executes a predefined sequence of actions if certain conditions are met.
What makes n8n suitable for this task is its low-code nature. This means you don’t need to be a professional developer to build sophisticated server management workflows.
You can build workflows in n8n by dragging and dropping nodes. Each node performs a specific function, whether it’s sending an API call, setting a filter rule, sending a notification on third-party apps, or scheduling task execution.
Important! n8n isn’t a drop-in replacement for tools like Grafana and Prometheus due to the lack of features specifically designed for server monitoring. However, it’s a more beginner-friendly option for basic tasks like alerting and is much easier to use, especially for non-developers.
Hostinger’s public API is a tool that enables you to interact with your Hostinger account and products programmatically. It allows your third-party applications, such as n8n, to connect and exchange data with your Hostinger account, including the associated VPS.
The Hostinger API is crucial for automating VPS management because it enables n8n to fetch data from your server, which is necessary for determining whether the tasks should be performed.
APIs typically have multiple endpoints – addresses that allow you to request particular data or take a specific action. For example, Hostinger API has endpoints that let you fetch data about backup, VPS information, and malware scanner summary, among others.
Hostinger API endpoints are also helpful for administering various aspects of your server. For instance, you can create a new Docker project or set a new firewall rule without directly interacting with your VPS. To learn more about all available endpoints and their usage, refer to our API documentation.
By integrating n8n and the API from Hostinger, you can set up a VPS management automation workflow in only three simple steps.
The API token is a unique authentication key that allows the Hostinger system to verify requests coming from third-party sources, like n8n.
Generating an API key at Hostinger takes these simple steps:


Copy the generated token and store it in a safe location, like an encrypted password manager. This is important because you won’t be able to see it again after closing the API token generation page.
Keeping the token safe prevents this credential from being compromised, which is crucial since cybercriminals can use it to obtain sensitive data or modify critical server settings.
Important! In addition to storing your token in a safe location, choosing a shorter expiration date safeguards your API token. The more frequently you update your token, the more difficult it becomes for cybercriminals to obtain a valid one.
At the same time, however, updating your token frequently can be tedious. In that case, choose an expiration period that best balances security and maintenance according to your needs.
After obtaining your API token, let’s check whether it works properly. You can easily do this by copying commands at the bottom of the token generation page and running them on your computer’s command-line application.

If you don’t receive any error message, it means the API token is valid, and we can proceed with setting up n8n.
After verifying the API token, obtain your VPS ID, which the API will use to identify the server and fetch the data. Here’s how to do so:
https://hpanel.hostinger.com/vps/123456/overview
You can set up n8n using two methods: manually on a self-hosted environment or using the official cloud plan.
We recommend self-hosting n8n in a VPS. Not only is this method more cost-effective than the cloud plan, but it also gives you complete control over the hosting environment and your data, resulting in a higher level of flexibility.
Important! Avoid hosting your n8n instance on the same VPS you want to monitor because your workflow will also fail if the server experiences downtime.
In addition, VPS providers offer various features that help you configure and manage your n8n instance more easily. For example, Hostinger’s self-hosted n8n plan provides OS templates that enable you to deploy n8n with just a few clicks, all without any commands.
If you want to see this template in action or learn how to manually deploy this automation platform, check out our tutorial on installing n8n.

Once n8n is deployed, use the API to connect this tool to your VPS.
Connecting n8n to Hostinger via API involves setting up the token as the HTTP node’s authentication method. Here’s how to do it:

https://developers.hostinger.com/api/vps/v1/virtual-machines/123456

This HTTP node is now connected to your VPS via the Hostinger API. Check if the integration works properly by clicking the Execute step button.
If the node’s right pane shows details about your VPS, the integration is successful. Otherwise, there might be issues like:
Once you have a working integration, create an actual workflow by adding and connecting more nodes. There are various tasks you can automate with n8n and the Hostinger API, but we’ll explore the simplest ones in the following section.
Here are several examples of simple VPS management tasks you can automate with n8n and the Hostinger API.
You can create a workflow that constantly monitors your server status and alerts you of potential downtime on a third-party app. This enables you to take the necessary actions immediately as soon as an issue arises.
To achieve this, you need to retrieve the server status using the API and set a rule that triggers alerts if the status indicates downtime. Here’s how to create it:
https://developers.hostinger.com/api/vps/v1/virtual-machines/123456
⚠️**Critical!** Potential downtime detected. Server status: {{ $json.state }} 
Important! When choosing the condition for your If node, pay attention to the type of data you are working with, whether it is a string, array, object, or another type.
The completed workflow looks like this:

Note that this workflow will still alert you during planned downtime, like a scheduled maintenance or deliberate restart, because it shows the stopped status.
To get around this, connect the if and wait node to set a logic that alerts you if the downtime lasts longer than the typical maintenance duration. Alternatively, you can pause the workflow by comparing the execution time and your restart schedule listed on a platform like Jira.
Automating backup logging enables you to track the available restoration points of your server, ensuring data integrity. You can also set up an alert to notify you whenever the latest automatic backup is logged.
You can accomplish this by retrieving the latest backup date from the Hostinger system and comparing it to the dates in the logs in a Google sheet. Here’s how to do it:
https://developers.hostinger.com/api/vps/v1/virtual-machines/123456/backups

✅**Backup logged!** Latest backup is added to the log.
Important! If you can’t see the columns in the Google Sheets node, make sure you selected the correct sheet and created the columns beforehand.
The completed workflow looks like this:

Hostinger VPS features built-in Monarx anti-malware, allowing for automatic scans. You can use the API to fetch scan results, create logs for security audits, and send notifications when malicious files are found.
Here’s how to create the workflow:
https://developers.hostinger.com/api/vps/v1/virtual-machines/123456/monarx

⚠️**Critical!** Last Monarx scan detected {{ $json.malicious }} malicious files and {{ $json.compromised }} compromised files. Your finished workflow looks something like this:

Automating resource usage monitoring enables you to receive automated alerts if your server load exceeds specific thresholds and automatically creates issues on Jira for further investigation.
To achieve this, use the API to fetch usage data, set a rule to determine whether it exceeds the normal threshold, and notify you of overly high loads.
Note that this workflow is significantly more complex than the previous ones, as it involves modifying the JSON in transit and requires interaction with additional external systems. For example, our specific setup requires the OpenAI and Jira APIs, as well as permission to your Jira workspace.
We’ll use the OpenAI API to connect an LLM into our workflow to analyze the usage spike. Then, we use the Jira API to create an issue in our workspace using the AI analysis results.
Here’s how to create the workflow:
https://developers.hostinger.com/api/vps/v1/virtual-machines/1268054/metrics
Analyze the following 24-hour resource usage metric of my VPS:
CPU average: {{ $json['CPU avg'] }}
RAM average: {{ $json['RAM avg'] }}
Outgoing traffic average: {{ $json['Out avg'] }}
Incoming traffic average: {{ $json['Inc avg'] }}
Classify whether the usage is mildly concerning, concerning, or criticalBased on your classification, identify potential causes and actionable steps for minimizing the usage.
Format your analysis as follows: The usage is: high/medium/normal I identify the problem lies in your (areas where the issue that causes the spike) I suggest you do the following: 1. Solution 1 2. Solution 2
Resource spike at {{ $now.format('yyyy-MM-dd HH mm ss') }}VPS resource usage exceeded the threshold.
Severity: {{ $json.message.content["The usage is"] }}
Potential causes: {{ $json.message.content["I identify the problem lies in your"] }}
Suggested solutions: {{ $json.message.content["I suggest you to do the following"] }}
⚠️**Critical!** VPS resource usage exceeded threshold. Automatically created Jira issue on: {{ $json.self }} A finished workflow looks like this:

Important! Since AI is unpredictable, sometimes each output is formatted differently. If this happens, your JSON might not pass the data correctly because the placeholder, such as The usage is in {{ $json.message.content[“The usage is”] }}, changes.
In the workflow, we already minimized this issue by providing the output format that the AI will follow as a System prompt. However, it’s crucial to test the workflow thoroughly to ensure the output remains consistent.
The Hostinger API offers additional endpoints that enable you to scale your n8n workflow to automate a broader range of tasks beyond simple status monitoring. You can check the complete list of endpoints in the API documentation page, among them:
n8n also provides various other nodes that enable you to process data more flexibly and integrate different applications into your workflow.
For example, you can add the PagerDuty node to set up a more robust disaster and incident management process. You can also connect multiple workflows for different tasks together to create a unified, scalable automation system.
Combining various n8n nodes and Hostinger API endpoints enables you to create a customized automation system tailored to your specific needs, which brings numerous benefits.
While combining n8n and the Hostinger API provides powerful automation capabilities, it’s essential to understand that this system has inherent limitations.
For one, tasks you can automate are limited to what the Hostinger API endpoints offer. While we continuously add more functionality to the API, some critical tasks must be done directly on the system for security reasons.
This limitation also means that you cannot create a fully self-healing automation workflow that takes corrective actions independently upon encountering errors. Even if the API allows it, developing a self-healing automation can be tricky because it may perform actions that can break the system, like shutting down a critical service to free up resources during a traffic spike, if not tested carefully.
While Hostinger API is currently not suitable for complex self-healing automation, it offers endpoints for basic management tasks like restoring a backup, changing a nameserver, or uploading SSH keys.
Following best practices when using n8n and the Hostinger API to automate VPS management is crucial to maintaining optimal security and workflow functionality.
Here are several best practices when using n8n to automate tasks:
Combining n8n and the Hostinger API enables you to streamline repetitive tasks and minimize human error, resulting in more efficient VPS management.
After understanding what n8n and the Hostinger API can achieve, it’s time to explore various endpoints and nodes to determine the most effective way to automate your VPS management.
In addition to an API, Hostinger provides an MCP-powered Kodee AI assistant to simplify VPS management further. Since it offers more extensive capabilities than the API, it makes an excellent complement to your automation system.
For example, you can restart services by simply chatting with the AI assistant. Like our API, you can use Kodee for free, which is also pre-configured on your VPS.
All of the tutorial content on this website is subject to Hostinger's rigorous editorial standards and values.