🚀 Introduction

  • Before you begin, make sure you have Python on your system. If you don’t have them yet, you can download them from the official Python website.
  • Next, you will need to create an account on Square Cloud, which can be done through the login page. You can use either your email or Discord, or both, to create an account.
  • Finally, you need to have an active paid plan on your account. You can view our plans and purchase one according to your needs here.

⚙️ Creating the squarecloud config file

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

The squarecloud.app file is a configuration file that will be used to configure your application; it will be used to define the name, description, version, main file, among other things.

▶️ Start Application

  • If the START field is not defined in the configuration file, Square Cloud will run python MAIN to execute the Python file specified in the MAIN field. If the START field is defined in the configuration file, the value in the START field will be executed directly. For more information on configuration file parameters, visit configuration parameters.

  • Square Cloud uses pip install to install all dependencies listed in the requirements.txt.

🖥️ Preparing Your Python Project

📁 Essential Configuration Files

When preparing your Python project for deployment on Square Cloud, ensure that you include your configuration file (squarecloud.app/.config) and the essential files of your application in a zip file.

The configuration (squarecloud.app/.config) file must be located in the root of the zip file. Otherwise, Square Cloud will not be able to find it during deployment.

🗑️ Files to Exclude Before Uploading

  • ffmpeg: This software is pre-installed in the Square Cloud environment, so there’s no need to include this folder in your project.
  • .venv: This folder contains the virtual environment for your project. Square Cloud provides an isolated environment, so this folder is not required.
  • poetry.lock: Since Square Cloud does not currently support Poetry, this file should be excluded to avoid any potential issues during deployment.

🤔 Why Exclude These Files?

Excluding ffmpeg, .venv and poetry.lock is important for several reasons:

  1. Clean Environment: Square Cloud creates a fresh environment for your project. Including these files is unnecessary and could lead to conflicts with the cloud environment’s configurations.

  2. Efficiency: Removing these files reduces the size of your upload, making the process faster and more streamlined.

  3. Compatibility: Excluding poetry.lock ensures that there are no compatibility issues, as Square Cloud relies on requirements.txt for installing dependencies.

Before uploading, make sure to zip your project files in .zip format, excluding the unnecessary files mentioned above. This will help ensure that your Python application is ready for a successful deployment to Square Cloud.

📄 Required Files

  • main.py (Example of main file).
  • requirements.txt (Dependency file).
  • OR [pyproject.toml] (Dependency file).
  • squarecloud.app (file that contains the Square Cloud configuration).

💡 Troubleshooting

📤 Uploading Project to Square Cloud

After preparing your project files, you can now upload them to Square Cloud and host your project.

Access the Square Cloud Dashboard and upload your project files.

If you continue to experience any issues, please don’t hesitate to contact our support team.