Skip to main content

Introduction

To host websites and APIs on Square Cloud, it’s essential to follow proper configuration procedures and meet the necessary technical prerequisites. This comprehensive guide will present the entire professional implementation process.

Technical prerequisites

  • Square Cloud Account: Create your account through the signup page, using your email address for registration.
  • Active plan: It’s necessary to have an active plan to ensure adequate resources and optimized performance. Check our available plans and choose the most suitable for your needs.

Square Cloud configuration file

Learn about: how to create the configuration file for Square Cloud.

The squarecloud.app file is an essential configuration file that will be used to configure your application on Square Cloud. It defines name, description, version, main file, among other fundamental configurations.

Essential parameters for websites

Your server must listen on port 80 and on host 0.0.0.0 (all network interfaces): Square Cloud delivers your subdomain’s traffic there. It sets the PORT (80) and HOST (0.0.0.0) environment variables for you, so read the port from PORT and keep a fallback of 80:
Many frameworks, such as Next.js and Nuxt, already read PORT on their own. Static websites don’t need a server or a START parameter at all. Main parameters of the squarecloud.app configuration file:
  • SUBDOMAIN: For website hosting, define this parameter with your desired subdomain. Set it on the first upload: an application uploaded without a subdomain can’t get one later.
  • START: Custom startup command (when necessary).
  • MEMORY: RAM allocated to your application, in megabytes. Websites and APIs need at least 512. Curious why there is a minimum value? See why RAM minimums exist.
The website URL will be: my-subdomain-parameter.squareweb.app

Configuration examples

Example 1: Static website without custom startup command
Example 2: Next.js website with a custom startup command
Run npm run build on your machine first and include the .next folder in the zip: Square Cloud doesn’t install devDependencies, so the build can’t run on the server. With a START command, RUNTIME=nodejs picks the Node.js runtime and no MAIN file is needed. For framework-specific details, see the Next.js guide.

Custom domain

To serve your website from your own domain (e.g., mysite.com) instead of mysite.squareweb.app, you need the Standard plan or higher. Follow how to set up your own domain in the help center.

Support for multiple technologies

Square Cloud offers comprehensive support for various web development technologies, providing flexibility in choosing the most suitable tech stack for your project.

React

Learn how to host your React website on Square Cloud.

Next.js

Learn how to host your Next.js website on Square Cloud.

NestJs

Learn how to host your NestJs application on Square Cloud.

Vite

Learn how to host your Vite website on Square Cloud.

Vue

Learn how to host your Vue website on Square Cloud.

Express

Learn how to host your Express API on Square Cloud.

Flask

Learn how to host your Flask application on Square Cloud.

Django

Learn how to host your Django application on Square Cloud.

FastAPI

Learn how to host your FastAPI application on Square Cloud.

Lavalink

Learn how to host your Lavalink server and stream high-quality music to your Discord bot.

Next steps

App won't start

Fix port conflicts, missing modules and other startup failures.

Environment variables

Keep API keys and connection strings out of your code.

Managed database

Create a database for your website or API.

Contact us

If you continue facing technical difficulties, our specialized support team is available to assist you. Contact us and we’ll be happy to help you resolve any issue: support quality is a big part of why developers rate Square Cloud 4.9/5 across 402 reviews on Google and Trustpilot.