banner
胡鹤仙的Blockchain Blog

胡鹤仙的Blockchain Blog

twitter
github
telegram
medium

Daily Skill: Deploying n8n Service with Zeabur

There are two tools mentioned in the title, let me give a brief introduction.

Zeabur is a service deployment platform developed by Chinese developers. It allows for easy deployment regardless of the programming language or development framework used. Common platforms such as Ghost, Halo, Umami, and even WordPress can be deployed using Zeabur.

n8n is an open-source workflow automation tool similar to IFTTT. It is comparable to shortcuts on iOS, where a certain action is triggered by a specific condition.

cover.webp

"Cyber Space"#

Because I consume information every day, such as articles, music, videos, and various tools and software, they are scattered across different platforms, making management cumbersome. To make future retrieval easier, I chose to use n8n to forward articles I read, videos I liked or donated to, music I enjoy, books I've read, movies I've watched, and various tools I've collected to a Telegram channel. Different types of content are labeled with different tags, making it quick and convenient to find them through tag indexing. This is my "Cyber Space".

So far, I have seen three people doing this: @novoreorx, @rayepeng_, and @pseudo_yu. Their blogs also have detailed introductions and tutorials, which I referred to a lot during the deployment process.

How to deploy n8n#

n8n requires a database. According to the Zeabur official documentation, I chose to use PostgreSQL. So, install the PostgreSQL client in advance. I used PostgreSQL 15, which can be downloaded from the official website. The purpose of this step is to connect to the PostgreSQL installed by Zeabur and create a new database named "n8n".

Installing PostgreSQL#

In Zeabur, there is a Marketplace where you can search for PostgreSQL and deploy the service with one click.

image

After deploying the database, you can see the relevant information in the "connect" section. You will need the Host, Port, and Username for the next steps.

image

Next, open the installed PostgreSQL 15 client, right-click on the top left corner of "Server", select Register→Server, and enter the Host, Port, and Username mentioned above. Finally, click Save to save the settings.

image

image

The Server I created is named "n8n". Then, right-click on the Database under "n8n", click Create Database, and create a database named "n8n". This is a very important step, and the name must be "n8n".

image

image

With that, the PostgreSQL setup is complete.

As for the cost of Zeabur, there is no need to worry. They provide a free plan with a monthly free quota of $5, which I think should be sufficient.

Installing n8n#

Similarly, you can find n8n in the Marketplace and click to deploy it.

image

After opening n8n, there will be settings for environment variables on the right side. You don't need to modify them, but you need to add two additional variable rules, otherwise there will be errors when creating credentials using n8n.

Based on the environment variables I provided, change the custom domain to your own, and then copy and paste all of them.

DB_POSTGRESDB_PASSWORD=${POSTGRES_PASSWORD}
PASSWORD=78nJ3L6u9Oh2
DB_POSTGRESDB_USER=${POSTGRES_USERNAME}
DB_POSTGRESDB_HOST=${POSTGRES_HOST}
DB_POSTGRESDB_DATABASE=n8n
WEBHOOK_URL=https://yourdomain
VUE_APP_URL_BASE_API=https://yourdomain
DB_TYPE=postgresdb
DB_POSTGRESDB_PORT=${POSTGRES_PORT}
EXECUTIONS_DATA_PRUNE=true
EXECUTIONS_DATA_MAX_AGE=72
EXECUTIONS_DATA_SAVE_ON_ERROR=all
EXECUTIONS_DATA_SAVE_ON_SUCCESS=none
EXECUTIONS_DATA_SAVE_ON_PROGRESS=false
EXECUTIONS_DATA_SAVE_MANUAL_EXECUTIONS=false

image

The final step is to bind a custom domain in Zeabur, which must be consistent with the environment variables mentioned above. Please refer to the Zeabur documentation for specific binding methods.

How to use n8n#

I haven't fully understood this aspect myself, so all the workflows are based on the code shared by @novoreorx and @pseudo_yu on GitHub. I imported them with one click, created my own credentials, and modified the information to run them.

Configuring YouTube is a bit complicated as it requires applying for the official API. However, it is simple to follow the official documentation and video tutorials. As for Bilibili, Netease Cloud Music, Raindrop, and GitHub activities, you only need to generate the corresponding RSS links using RSShub. Let me say that RSS is awesome, RSShub is awesome, and DIYgod is awesome.

I have uploaded my workflows to GitHub. Just upload these .json files to n8n.

image

YouTube uses Google's official API, which can be configured by following the documentation. I use Raindrop as a bookmarking tool, both for collecting tools and articles. So, I created two collections named "article" and "tool" and enabled the sharing function to obtain their RSS addresses. GitHub and Douban have official RSS addresses that can be used directly. Netease Cloud Music and Bilibili require the use of RSShub to generate RSS addresses. I originally wanted to add Twitter, but its API has been made too difficult by Musk, so I gave up.

References#


The above is the entire process of deploying n8n using Zeabur. Although it is not as quick and convenient as deploying with Docker, it is still worth trying. Also, feel free to follow my Telegram personal channel to see the content I am interested in. Perhaps we will have something in common.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.