December 9, 2025

Your first... n8n

This is a translation of my article. The original is in Russian.

So there’s a lot of hype around n8n - what’s the deal with it?

Basically, it’s an open-source automation tool. You can use it in two formats: as a SaaS product or host it yourself locally/on a remote server.

SaaS is cool, but it’s PAID (after the first 14 days). Plus, it has some drawbacks: a limit on how many times your workflows can run, no control over the version, networking, or using local files and Linux utilities. It’s fine for simple personal workflows though.

Self-hosting is a bit more complicated to set up, but once you figure it out, you can build Telegram bots non-stop.

How do you set up your own instance?

The ideal option is to rent a VPS. That way you instantly get a dedicated IPv4 address, which works just fine with ChatGPT, Claude, and Gemini.

If you just want to play around, I can recommend a VM with 2 cores and 2GB RAM for free for 10 days (not an ad). Choose Ubuntu and wait for the server to start. In the dashboard, just Ctrl+C those digits.

Next, you need to get a domain and an SSL certificate. I usually do it here (click). Pick a 3rd-level domain, hook up the DNS to the copied IPv4, and in the “Free SSL certificates” section generate a cert. You should end up downloading an archive with 3 files inside: ca.cer, YOURDOMAIN.cer, and YOURDOMAIN.key. You’ll need those so Telegram trusts your server (when we get to configuring the Telegram bot).

Transfer those files to your VPS. I put them in a folder called certs. I use the “Remote Host” feature in IntelliJ IDEA for that:

But you can also just use a regular docker cp.

Just in case, you should give access permissions to those files (in SSH terminal):

cd /certs
chmod 777 ca.cer
chmod 777 YOURDOMAIN.cer
chmod 777 YOURDOMAIN.key

You’ll also need to transfer docker-compose.yaml and the Dockerfile to the server. Download them here (click):

In the docker-compose.yaml, replace YOURDOMAIN with the one you created above.

And that’s basically launching n8n.

First, install Docker and Docker Compose on the VM. These are tools for running any service in CONTAINERS. In short, a container is a “packaged” application (configured in docker-compose.yaml) that runs isolated from the rest of the system. Official instructions:

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

echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
  $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update

sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
 
sudo systemctl status docker
# Here you should see: Active: active (running)

Then launch your containers:

# go to the folder with docker-compose.yaml, in my case /n8n
cd /n8n

docker compose up

After the last command, you’ll see a log showing the containers started successfully—or an error if something went wrong. When you see a message like:

Editor is now accessible via:
n8n-1         | https://YOURDOMAIN

You can check it in your browser, and you should see this interface appear.

To completely stop the containers when you’re done, run this in the same directory:

docker compose down

By the way, you can also run containers in the background so they don’t occupy your terminal and you can run other commands:

docker compose up -d

When do we get to creating the Telegram bots?

Alright, here we go.

Create a new workflow.

Add the first step.

Choose the Telegram trigger On Message.

In this window, you need to set up the credentials.

If you’ve never created a Telegram bot before, you can do it via @BotFather. Copy the token from there:

Paste it into the window above. This trigger will fire whenever a user sends a message to your bot. You can test it by clicking Execute Workflow.

Next, add a response message. Make sure to send it to the same chat ID that triggered the workflow.

Save and activate your workflow (so it runs automatically, not just when you execute it manually).

Test it…

Congrats, you’ve completed the n8n basics course.

That’ll be $100 from you

Now you can set up calls to AI, scripts, and other stuff—but that’s a story for another time 😉