Apps
Run your own code on WebShield — Node.js, Python, Go, PHP or any Dockerfile. Builds, deployments, Postgres and Valkey, environment variables, your own domain behind the WAF, logs and rollback.
Apps runs your code on our side: web apps, APIs, webhook bots. The code is built from source, and requests to it get the same protection as a regular proxied site — WAF, rate limits, bans and, if you want, bot protection. An app has no port open to the internet: it is reachable only through WebShield.
You will find it in the control panel under Services → Apps. It is in beta. A Workers API project runs here too — as a function.
For your first deployment, follow How to publish a Python app: a small Flask example, from source files to your own address, with an update and rollback.
Publish a Laravel website — PHP, Vite, Postgres and HTTPS forms.
Projects and apps
Section titled “Projects and apps”A project is a shared space for the apps of one system: its own limits and images, and apps of different projects cannot see each other. An app is one running service inside a project. A project also holds its Postgres databases and Valkey stores.
Project and app names use lowercase Latin letters, digits and hyphens. An app’s name and its project cannot be changed after creation.
Port. The app must serve HTTP on the port from its settings (8080 by default). The same
number comes in the PORT environment variable — listening on it is the easiest way.
Deploying
Section titled “Deploying”There are three ways to ship code:
- From a terminal or CI:
webshield apps deploy— the CLI packs the directory and uploads it (details below). - An archive from your computer: Deployments tab → Upload .tar.gz.
- A link to an archive: an https link to a
.tar.gzthat opens without signing in, for example a branch archive of a public GitHub repository:https://github.com/<owner>/<repo>/archive/refs/heads/main.tar.gz.
If the app is not at the root of the archive, set the folder inside the archive.
How it is built. With a Dockerfile at the root (or in the chosen folder), the build
uses it. Without one, the stack is detected from the project files: Node.js
(package.json), Python (requirements.txt, pyproject.toml), Go (go.mod), PHP, Ruby,
Java, a static site and others.
Statuses: Queued → Building → Starting → Live. If something goes wrong, you get Failed with the reason and the build log (Build log button). Until the new version starts, the previous one keeps serving: a failed deployment does not take the site down.
A first build without a Dockerfile can take a few minutes; later ones are faster.
Limits: the archive is up to 100 MB, a build runs up to 30 minutes. An app has one deployment in progress at a time.
Rollback and redeploy
Section titled “Rollback and redeploy”In the deployment history the live version has Redeploy, earlier ones have Roll back to this. Both roll out the already built image without a new build, so they take seconds. Any of the last five successful deployments can be restored.
Redeploy is also how changed environment variables and settings take effect: they apply on the next deployment. A rolled-back version also gets the current variables, not the ones it was originally deployed with.
Environment variables
Section titled “Environment variables”Variables tab: a name and a value. Values are stored encrypted and reach the app as
environment variables. Names use Latin letters, digits and _ and do not start with a
digit. PORT and names starting with K_ are reserved by the platform.
Databases: Postgres
Section titled “Databases: Postgres”Every database is a Postgres instance of its own, reachable only by the apps of the project: a name, a size of up to 20 GB and, if needed, a replica on another node. Backups run on their own, and restore is into a new database at any moment of the last 7 days.
Creation, connection, code examples and restore — on the Postgres database page.
Valkey: caches, sessions, queues
Section titled “Valkey: caches, sessions, queues”A key-value store compatible with Redis clients: 64–512 MB of memory, optionally kept on disk. Creation, connection and code examples — on the Valkey store page.
References in variables
Section titled “References in variables”No need to copy connection strings: put a reference into an environment variable and it is replaced with the real value on deployment.
| Reference | Value |
|---|---|
${{db.url}} |
Postgres connection string of database db |
${{cache.url}} |
Valkey connection string of store cache |
${{db.host}}, .port, .user, .password, .database |
separate parts |
For example, DATABASE_URL = ${{db.url}} and REDIS_URL = ${{cache.url}}. A reference to a
missing database stops the deployment with an error while the previous version keeps serving.
After changing variables, press Redeploy.
Your own domain
Section titled “Your own domain”The Hostnames tab attaches a hostname of your domain to the app: a subdomain
(app.example.com) or the domain itself.
The domain’s nameservers point to WebShield — everything happens by itself: within a minute or two the hostname gets a DNS record and a certificate and starts serving the app. If the name had its own A, AAAA or CNAME record, it is kept and comes back when you detach the name.
The domain is connected by records (nameservers stay with your provider) — two records
appear under the name. First _acme-challenge.<name> CNAME: it proves the name is yours; add
it and press Verify. Once confirmed, the certificate is issued, and then the second
record — the name itself as a CNAME to our address — moves the traffic. The order is the same
as for connecting with records, which also covers the
domain apex and CAA records. A detached name loses its address: to bring it back, attach it
again and set the new records.
Protection is configured in Hosts — the Protection settings button next to the name leads straight there: bot protection, captcha, path exclusions, request size limit, cache. The host mode is App: to change it, detach the name.
The Log tab shows the app output (stdout and stderr): a period from 5 minutes to 7 days, text search, and Follow prints new lines as they arrive. Lines are kept for 7 days.
Log to stdout — files written inside the container disappear on restart.
Sleep and wake-up
Section titled “Sleep and wake-up”Always running instances:
- 0 — the app sleeps when there are no requests and wakes up on the first one. The first response after sleep waits for the app to start: two or three seconds for Go and Node.js, about five for Python with a framework. The first start on a new server takes longer: the image is downloaded there. Requests that arrive during the wake-up wait for it and are not lost.
- 1 or more — the app never sleeps.
If the app process exits, it restarts on its own within a second or two; a request that lands exactly at the crash gets 502, the following ones wait for the start. If it keeps crashing, the pause before each new restart grows up to 30 seconds, and the site does not answer all that time: look for the cause in the log. With two instances, visitors will barely notice one of them crashing.
Maximum instances caps scaling under load. Both settings apply on the next deployment.
An app must not keep data on its own disk: it starts clean after a restart or when scaled. Keep data in a Postgres database and files in object storage.
Payment
Section titled “Payment”Apps are pay-as-you-go: a project is created right away with no prepayment, and an invoice for what you used comes once a month. Until the first payment, one project is available, capped at 1 vCPU and 1 GB of reserved memory (bursting to 4 vCPU and 3 GB: enough for an app, a database and Valkey). Prices are shown in the section, above the project list.
Before you create your first project, the control panel asks you to accept the postpaid terms and shows your available credit limit. Creating a project does not run an app or incur charges; charges begin when resources are used.
You pay per second for what runs:
- CPU and memory — what the app, database or Valkey store actually uses, but not less than the minimum reserved for it. A sleeping app costs nothing.
- Disk — the ordered size of database volumes and on-disk Valkey stores while they exist.
- Database backups and function data — the size of backups and the change log, and the data of functions, at the price of object storage.
Charges add up daily and are debited once a month. Above the projects you see what is charged so far and how much is left before the credit limit. When the limit is used up or an invoice is unpaid, you get an email, new deployments and databases close, and 7 days later apps, databases and Valkey stores of all projects pause: requests get a 503 response. Volumes and data are kept, disk space is still charged. Pay the outstanding amount and everything starts again within a few minutes.
Spending cap. Set an amount per calendar month in the Project spending card. Once spending reaches it, the project sleeps the same way until next month, or until you raise or remove the cap. The same card shows what the project has spent since the start of the month.
From a terminal and CI
Section titled “From a terminal and CI”webshield apps deploy --project shop --app web # pack the directory, upload, wait until livewebshield apps logs --project shop --app web -f # follow the logwebshield apps deployments --project shop --app webwebshield apps redeploy 42 # roll back to deployment #42webshield apps env set DATABASE_URL='${{db.url}}' --redeployVariables, databases and Valkey are managed from the terminal too — apps env, apps db,
apps kv; every command is in the CLI reference.
To skip the names every time, put webshield.toml next to the code:
[app]project = "shop"name = "web"The archive holds everything except .git and what .gitignore and .webshieldignore
(same syntax) exclude. Hidden files such as .npmrc stay. deploy waits until the
deployment is live; on failure it prints the tail of the build log and exits with a non-zero
code, so the CI job fails.
For CI, issue a token for CI in the project card: it can only deploy this project and read its status and log — it cannot create apps, change variables or touch domains. Step by step: Deploy from a private repository.
General API tokens with the Apps area are issued in settings.