Skip to main content
Square Cloud runs your code in an isolated container that stays online around the clock. You send the project once, and from then on you manage one application: update it, restart it, read its logs. This page explains the few concepts everything else builds on.

The pieces

Two kinds of application

The SUBDOMAIN line of the configuration file decides which kind you create: HTTPS is handled for you: the certificate is issued and renewed by Square Cloud, and requests reach your server as plain HTTP on port 80.
The kind is chosen at the first upload. An application created without SUBDOMAIN can’t become a website later, and a website can change its subdomain but can’t lose it.

The life of an application

1

Upload creates it

You send a .zip with your code and the configuration file. Square Cloud picks the runtime from RUNTIME or from the extension of MAIN, creates the container with the RAM you asked for and starts it. The application gets an ID that never changes.
2

It runs until you stop it

Applications don’t sleep when idle. With AUTORESTART=true, an application that crashes is started again.
3

A commit updates it

A commit sends new files to the same application. The ID, the address, the settings and the environment variables stay. The new code runs after a restart.
4

Deleting it frees the RAM

The RAM goes back to your plan’s pool. A stopped application keeps its RAM reserved.

What runs at each start

Every start, including a restart and an automatic restart, goes through the same three steps:
  1. Environment variables are loaded. The ones you set, plus PORT, HOST and the others Square Cloud sets for you.
  2. Dependencies are installed from your dependency file: package.json, requirements.txt and so on. Node.js installs only when there is no node_modules folder yet, so the first start takes longer than the next ones.
  3. Your code starts, with the START command or, without one, the default command of the runtime for your MAIN file.
There is no separate build phase and no shell to run commands in. A command that has to run on the server goes in START, and it runs at every start. The runtimes page lists the default command and the dependency file of each language.

What is kept

Environment variables are kept through restarts and commits. Files your application writes while it runs, such as a SQLite file, a JSON file or uploaded images, live on its 10 GB disk and survive a restart. Two things take them away: a commit that sends a file with the same name, and a snapshot restore. So:

Resources and limits

  • RAM is the one number you choose, with MEMORY. It comes out of your plan’s pool and also sets the application’s vCPUs and bandwidth.
  • Disk is 10 GB per application and per database.
  • Square Shield watches RAM, CPU, disk and the requests an application makes to external APIs. An application that goes over a limit is stopped, or has its requests limited, and its log says why. See the limit statuses.

Pick your tool

Every tool below manages the same applications, so you can use the one that fits each task and mix them freely:

Next steps

Quickstart

Put a first application online in a few minutes.

After your first deploy

Update, restart, read logs and take snapshots.

Plans and pricing

How much RAM each plan gives you to share.

Limits

Minimum RAM, vCPUs, network, disk and the limit statuses.