Environment variables, kept out of your code
Store tokens, passwords and connection strings in each application's settings. Values stay masked on screen, a .env comes in with one paste, and a restart applies the change without a new upload.
How it works
Variables belong to the application, not to the files you upload. Change one and the next start picks it up.
- 1
Add or paste
Type a key and its value, paste KEY=value lines into a key field, or import a .env file.
- 2
Save
One save sends the whole list. Values the shell would split or expand are quoted on the way.
- 3
Restart
Right after saving, the dashboard offers to restart. The application starts with the new values, with no new upload.
Secrets stay hidden on screen
The editor in your application's settings masks every value until you ask for it and keeps related keys together.
Masked values
Values show as dots. Reveal one with the eye, copy it without revealing it, or click it to edit.
- Each edit is confirmed or canceled on its own
- Hold Shift to remove a row in one click
Grouped by prefix
Keys that share a prefix, such as DB_HOST and DB_USER, are listed together, in alphabetical order.
- Search by key once the list passes 15
- A warning shows when few slots are left
Square Cloud defaults
HOST, PORT and SQUARECLOUD_APP_ID come with every application, shown read-only with a note on what each is for.
- HOST 0.0.0.0 and PORT 80 for HTTP
- The application's own ID at runtime
- Up to 256 variables per application
- Keys up to 1,024 characters, values up to 4,096
- In a workspace, only admins open the editor
- Included on every plan
Bring the .env you already have
Import a .env file and review it before anything changes: new keys, keys that would be replaced and lines that can't come in, each with its line number and the reason.
Paste whole lines
Paste several KEY=value lines into a key field and each one becomes a row. A key you already have takes the pasted value.
- Comments and the export prefix are handled
- Pasting into a filled row keeps that variable
Set them while deploying
The deploy form takes variables too, and when your project has a .env.example it offers those keys for you to fill in.
- Also reads .env.sample, .env.template and .env.dist
- Leaves HOST and PORT to Square Cloud
Export or copy
Download every variable as a KEY=VALUE text file, or copy them all, to move them to another application.
- Values come out quoted, ready to load
- Rows without a key are left out
Values reach your code as you typed them
Your application loads its variables through a shell, where a space, a $ or a ; can cut a value short or change it. The editor quotes those values for you.
Quoted where needed
A value with spaces or characters such as
$,&,;,|or)goes in single quotes when you confirm it, import it or save.Risky quotes refused
Double quotes around a value with
$would let the shell expand it, so the editor asks you to remove them or use single quotes.Keys kept valid
Spaces in a key become underscores, and a key can't appear twice. In an import, a key must start with a letter or
_.
From the terminal and the API
The same variables are reachable from the CLI, the GitHub Action, the VS Code extension and the REST API.
squarecloud app env set DB_HOST=10.0.0.4 "GREETING=hi there"squarecloud app env set --from-file .envsquarecloud app env listSince version 3.1.1, the CLI quotes values with spaces or symbols for you. See everything the CLI does.
curl -X POST "https://api.squarecloud.app/v2/apps/$APP_ID/envs" \ -H "Authorization: $SQUARECLOUD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"envs": {"NODE_ENV": "production", "LOG_LEVEL": "info"}}'curl -X POST "https://api.squarecloud.app/v2/apps/$APP_ID/restart" \ -H "Authorization: $SQUARECLOUD_API_KEY"Send values as the shell should read them, in single quotes when they have spaces or symbols. A restart applies them.
- GET
/v2/apps/{appId}/envsList the application's environment variables.
- POST
/v2/apps/{appId}/envsAdd variables or change existing ones. The rest stay as they are.
- PUT
/v2/apps/{appId}/envsReplace every variable with the ones you send.
- DELETE
/v2/apps/{appId}/envsRemove the variables you name.
- API keys can be limited to
envs:readorenvs:write, and to a single application.
Questions about environment variables
What are environment variables on Square Cloud?
Do I need to deploy again after changing a variable?
Which variables does Square Cloud provide?
How do I store a value with spaces, quotes or a $?
Can I keep a .env file in my project?
Who can see the values?
How many variables can an application have?
Do static sites have environment variables?
A plan for every stage of your project
Start small and scale when you need to, with no loyalty contracts.
Hobby
To validate ideas, bots and personal projects
From R$12.49/mo ≈ $2.25
- 1 GB RAM
- 1 vCPU
- Up to 4 projects
- Scales up to 2 GB on the same plan
Standard
RecommendedFor production, with databases and custom domains
From R$44.99/mo ≈ $8.10
- 4 GB RAM
- 4 vCPU
- Up to 16 projects
- Scales up to 8 GB on the same plan
Pro
For high scale, with daily application snapshots and advanced analytics
From R$124.99/mo ≈ $22.50
- 12 GB RAM
- 6 vCPU
- Up to 48 projects
- Scales up to 24 GB on the same plan
4.9 out of 5 · 402 reviews on Google + TrustpilotTrustpilot