> ## Documentation Index
> Fetch the complete documentation index at: https://docs.squarecloud.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Migrate from Heroku to Square Cloud

> Migrate from Heroku to Square Cloud: map your Procfile, Config Vars, Postgres and logs, deploy with the CLI and point your custom domain.

## What you get on Square Cloud

* **Predictable flat pricing in BRL**: one monthly plan price covers the RAM and vCPU your applications use. See [Plans and Pricing](/en/platform/plans).
* **Dedicated resources**: RAM and vCPU are reserved for your applications.
* **Deploy in seconds**: upload a zip or push via CLI and your application is running.

## Concept mapping

| Heroku | Square Cloud |
| - | - |
| `Procfile` (`web:`/`worker:` process types) | [`squarecloud.app` configuration file](/en/getting-started/config-file): `MAIN`/`START` fields |
| Buildpacks | [Runtimes](/en/runtimes/introduction): automatic language detection, no buildpack to choose |
| Config Vars | [Environment variables](/en/platform/environment-variables), set in the dashboard or uploaded from a `.env` file |
| `$PORT` | `PORT`, set to `80` on Square Cloud, plus `HOST=0.0.0.0`: code that listens on `process.env.PORT` keeps working |
| Heroku Postgres | [Square Cloud managed databases](/en/services/databases) (PostgreSQL, MySQL, MongoDB, Redis) |
| `heroku logs --tail` | [`squarecloud app realtime`](/en/cli-reference/logs#squarecloud-app-realtime) to stream live logs, [`squarecloud app logs`](/en/cli-reference/logs#squarecloud-app-logs) for the most recent lines, or the dashboard logs |
| Custom domains (paid dynos) | Custom domains on the [Standard plan or higher](/en/platform/plans) |

## Migration steps

<Steps>
  <Step title="Create your configuration file">
    Replace your `Procfile` with a `squarecloud.app` file at the root of your project. A Heroku `Procfile` like:

    ```
    web: node index.js
    ```

    becomes:

    ```systemd squarecloud.app theme={"system"}
    MAIN=index.js
    MEMORY=512
    VERSION=recommended
    DISPLAY_NAME=My migrated app
    SUBDOMAIN=my-app
    ```

    A `web` process must listen on host `0.0.0.0` and on the port in `PORT` (`80`). For a worker process type, drop `SUBDOMAIN` and set `START` to your worker's start command instead. See the [configuration file reference](/en/getting-started/config-file) for every field.
  </Step>

  <Step title="Set your environment variables">
    Export your Heroku Config Vars (`heroku config`) and set the same keys on Square Cloud, either from the dashboard's environment variables panel or by uploading a `.env` file:

    ```bash theme={"system"}
    squarecloud app env set --from-file .env --app <appID>
    ```

    Then restart the application: it reads environment variables when it starts. See [Environment variables](/en/platform/environment-variables).
  </Step>

  <Step title="Deploy">
    Upload your project via the CLI or the dashboard:

    ```bash theme={"system"}
    squarecloud upload
    ```

    See [How to Host your Website/API](/en/tutorials/how-to-deploy-your-website) for a full walkthrough of both methods.
  </Step>

  <Step title="Point your DNS">
    Once the app is live at `<subdomain>.squareweb.app`, point your domain's DNS at Square Cloud and attach it from the CLI:

    ```bash theme={"system"}
    squarecloud app network domain example.com --app <appID>
    ```

    Custom domains require an active Standard plan or higher. For the DNS records, see [how to set up your own domain](https://help.squarecloud.app/en-us/article/how-to-set-up-your-own-domain-cnamedns-1fzbrgh/) in the help center.
  </Step>
</Steps>

## Key differences to plan for

* **Region and latency.** Square Cloud's data center is located in New York: see the [Platform Overview](/en/platform/overview) for infrastructure details. If most of your users are in a different region than your current Heroku dyno region, measure latency before cutting over.
* **An active plan is required.** Every application runs on one. See [Plans and Pricing](/en/platform/plans) to pick the right tier for your workload.
* **Databases move separately.** Migrating Heroku Postgres data means exporting it (e.g. `pg_dump`) and restoring it into a new [Square Cloud managed database](/en/services/databases): plan a maintenance window for the cutover.

## Next steps

<CardGroup cols={3}>
  <Card title="Configuration file" icon="file-code" href="/en/getting-started/config-file">
    Every field of the file that replaces your Procfile.
  </Card>

  <Card title="Environment variables" icon="key" href="/en/platform/environment-variables">
    Move your Config Vars and keep secrets out of your code.
  </Card>

  <Card title="Managed database" icon="database" href="/en/tutorials/how-to-deploy-your-database">
    Create the database that replaces Heroku Postgres.
  </Card>
</CardGroup>

## Contact us

If you continue facing **technical difficulties**, our **specialized support team** is available to assist you. [**Contact us**](https://squarecloud.app/en/support) 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**](https://www.trustpilot.com/review/squarecloud.app) on Google and Trustpilot.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.