Skip to main content

Introduction

  • This article guides you through creating and hosting a n8n application on Square Cloud.
  • Before getting started, make sure you have an account on Square Cloud, which can be done through the sign up page. You can use your email to create an account.
  • Finally, you need to have an active paid plan with at least 4GB RAM on your account. You can view our plans and purchase one according to your needs here.

Creating the Project

  • First of all we need an javascript environment. To do this, we need a package.json.
  • The package.json must contain on dependencies field the n8n and must have the scripts to start it. Here’s the example:
{
  "name": "squarecloud-n8n",
  "version": "1.0.0",
  "main": "index.js",
  "type": "module",
  "scripts": {
    "start": "n8n"
  },
  "author": "Square Cloud Education <squarecloud.app>",
  "license": "ISC",
  "dependencies": {
    "n8n": "latest"
  }
}
We already have everything ready for deploy on our repository here. You just need to download the project.zip and upload it.

📁 Necessary Files

The following files are necessary in your zip:
  • package.json
  • .env (optional)

⚙️ Configuration File

  • You need to configure runtime environment to Detect manually and set it to NodeJS. In a squarecloud.config or squarecloud.app will look like this:
squarecloud
DISPLAY_NAME=App name
RUNTIME=nodejs
START=npm run start
VERSION=recommended
SUBDOMAIN=my-n8n-subdomain
  • Next, we need to set 2 environment variables, N8N_HOST and N8N_PORT in a .env file or in the Square Cloud environment on the upload menu. Their values must be 0.0.0.0 and 80.
.env
N8N_HOST=0.0.0.0
N8N_PORT=80

Uploading the Project to Square Cloud

After preparing your project files, you can now upload them to Square Cloud and host your project.
  • Upload via Dashboard
  • Upload via CLI
Access the Square Cloud Dashboard and upload your project files.