🚀 Introduction
- The Bun runtime is an alternative JavaScript runtime you can choose for your project. If you don’t have Bun installed locally yet, you have two main options:
-
Install via npm (recommended to ensure
npx bunis available during deploy):
- Or install Bun with the official native installer (check Bun’s docs for instructions).
-
By adding
bunas a dependency you can usenpx bunin theSTARTfield of yoursquarecloud.appto run your app with Bun. See the “Starting the Application” section below forSTARTexamples. - Next, you’ll need to create a Square Cloud account via the login page. You can sign up with your email, GitHub, or both.
- Finally, you must have an active paid plan on your account. You can view and purchase plans here.
⚙️ Creating the squarecloud configuration file
Learn more: how to create the configuration file for Square Cloud.
The
squarecloud.app file is a configuration file used to configure your
application; it defines the name, description, version, main file, and more.▶️ Starting the Application
- To use the Bun runtime on Square Cloud, add the
bunpackage to your project (for examplenpm install bun) so thenpx buncommand is available in the runtime environment. - Then set the
STARTfield in yoursquarecloud.appto the command that starts your app using Bun. Example:
OR .config
package.json scripts with Bun, use:
-
Remember: if the
STARTfield is defined, its value will be executed directly. For more information about configuration file parameters, visit configuration parameters. -
If the
node_modulesfolder is not present, Square Cloud will run:
.npm folder.
If you plan to use Bun as the runtime, we recommend adding bun as a dependency (npm install bun) to ensure npx bun is available during deploy. If you prefer Bun’s native installer, check compatibility and build requirements before choosing that approach.
🖥️ Preparing your Bun project
📁 Essential configuration files
When preparing your Bun project for deploy on Square Cloud, make sure to include the configuration file (squarecloud.app/.config) and your application’s essential files inside a zip archive.
The configuration file (
squarecloud.app/.config) must be located at the root of the zip file. Otherwise, Square Cloud will not be able to find it during deployment.🗑️ Files to exclude before upload
node_modules: This folder does not need to be uploaded because it will be recreated during production install.package-lock.json: This file is not required because the production environment will install dependencies based onpackage.json.
🤔 Why exclude these files?
There are several reasons to excludenode_modules and package-lock.json before uploading your project:
-
Consistent installs: Not uploading
node_modulesensures dependencies are installed by the production environment, resulting in a consistent build free from local system discrepancies. -
Updated installations: The production environment will install compatible, up-to-date versions of dependencies listed in
package.json, providing a clean start for your app. - Reduced upload size: Excluding these folders reduces the upload size, speeding up upload and deployment.
📄 Required files
The following files are required to host your Bun project:- squarecloud.app/.config
- mainFile.js/.ts (example main file)
- package.json (dependencies file)
💡 Troubleshooting
The main file is invalid or corrupted
The main file is invalid or corrupted
This error occurs when the file defined as “main” for your application in
the configuration file does not exist, is written incorrectly, or the path
is incorrect. If your main file is inside a folder, for example, you should
enter
folder/file.js.Bad Memory
Bad Memory
The minimum amount of RAM required to host a bot is 256MB, and for a
website/API, it’s 512MB. However, depending on the size and complexity of
your application, it may be advisable to allocate a larger amount of RAM to
avoid the
LACK_OF_RAM
error.
📤 Uploading Project to Square Cloud
After preparing your project files, you can now upload them to Square Cloud and host your project.- Dashboard Upload
- CLI Upload
Access the Square Cloud
Dashboard and upload your project
files.


