# Gyro Serverless Containers: no servers to rent, pay per container

https://www.gyrohosting.com/en/knowledgebase/article/gyro-serverless-containers

- **What you will learn**: how to pick a size for a container in serverless mode, how the price is calculated, autoscaling and the limits.
- **Time**: 7 minutes

## 1. Serverless vs. dedicated nodes

|  | Dedicated nodes (Starter / Standard / Pro) | **Serverless** |
| --- | --- | --- |
| What you rent | Nodes reserved for you (e.g. 2 × 2 vCPU / 4 GB) | Nothing; only running containers |
| Size | Containers fit into your nodes | You pick **vCPU + memory** per container |
| Price | Environment + per node, hourly (monthly cap = package price) | **vCPU-hour + GB-hour**, only while running |
| Best for | Steady, predictable load | Small services, test environments, spiky traffic |

The panel, address (`<service>-<code>.gyroapp.net`), versions/rollback, variables, secrets, custom domain + free SSL, logs, image registry, API, CLI and Terraform are **the same in both modes**.

## 2. Sizes

Every container copy uses one of these combinations (industry standard table):

| vCPU | Memory options |
| --- | --- |
| 0.25 | 0.5 GB · 1 GB · 2 GB |
| 0.5 | 1-4 GB (1 GB steps) |
| 1 | 2-8 GB (1 GB steps) |
| 2 | 4-16 GB (1 GB steps) |
| 4 | 8-30 GB (1 GB steps) |

An invalid combination (e.g. 0.25 vCPU / 4 GB) is refused and the allowed values are shown. 8 and 16 vCPU sizes will open later.

Each copy also gets **4 GB local disk** (writable layer + `/tmp` 512 MB); use Object Storage or a separate database server for persistent data.

## 3. Your first serverless service

1. Order **Gyro Serverless Containers** (prepaid; roughly 24 hours of the smallest container in your balance is enough to order).
2. On the service page: **Services → New service**.
3. Enter a name, an image (e.g. `nginxinc/nginx-unprivileged:alpine`) and the port (8080).
4. Pick vCPU in **CPU / copy** and memory in **Memory / copy**. The **estimated hourly price** is shown under the form.
5. Switch on **Public** and press **Create**. Within seconds the service is live on its HTTPS address.

CLI:

```
gyro container service create SERVICE_ID --name web --image nginxinc/nginx-unprivileged:alpine \
  --port 8080 --replicas 1 --cpu-m 250 --memory-mi 512 --public
```

Terraform:

```
resource "gyro_container_service" "web" {
  service_id = 12345            # serverless service id
  name       = "web"
  image      = "nginxinc/nginx-unprivileged:alpine"
  port       = 8080
  replicas   = 1
  cpu_m      = 250              # 0.25 vCPU
  memory_mi  = 512              # 0.5 GB
  public     = true
}
```

## 4. How the price is calculated

Every **running copy** is measured minute by minute and charged from your balance at the top of the hour:

`hourly price = vCPU × price per vCPU-hour + GB × price per GB-hour`

| Example (1 copy, 24/7) | Hourly | Full month (730 h) |
| --- | --- | --- |
| 0.25 vCPU / 0.5 GB | €0.0087 | ~€6.31 |
| 0.5 vCPU / 1 GB | €0.0173 | ~€12.63 |
| 1 vCPU / 2 GB | €0.0346 | ~€25.26 |
| 2 vCPU / 4 GB | €0.0692 | ~€50.52 |

Current prices: **€0.0298 per vCPU-hour**, **€0.0024 per GB-hour**. (VAT excluded; the current price on the product page applies.)

- A service scaled to 0, stopped or deleted is **not charged**.
- There is no "monthly maximum" in serverless mode: you pay for what you use.
- Image registry: 2 GB free per environment, then €0.05 per GB-month.
- The Spending screen shows separate **CPU** and **memory** lines per service with the measured hour.

## 5. Autoscaling

Turn on **Autoscaling** in the service settings: min / max copies and target CPU percent. Copies are added under load and removed when it drops; only running copies are charged. Your account limit for containers running at once (default **16 vCPU / 32 GB**) is on the product page; open a ticket to raise it for your account.

## 6. Security and isolation

- Every container runs in **its own isolated kernel sandbox**; it cannot see or reach another customer's containers on the same machine.
- Containers run as a non-root user without privileges; infrastructure networks and management systems are unreachable.
- Outbound SMTP port 25 is closed (use 587).
- CPU, memory and disk of each copy are limited to the size you picked; a copy that exceeds it is restarted (Logs → Previous instance).

## 7. FAQ

**Why did my container wait a few minutes on first start?**

If the region has no free capacity at that moment, new capacity is prepared (usually 2-5 minutes). The service shows "Starting"; waiting is not charged.

**I got "the region is at capacity for this size".** Try a smaller size or fewer copies, or try again in a few minutes.

**Can I move from dedicated nodes to serverless?**

Run the same images in a new serverless service and point your domain there; both products can run side by side.

**Does an image that needs root work?**

No; in serverless mode containers always run as a non-root user. Use images such as `nginxinc/nginx-unprivileged`.

## Next step

- [Serverless or node-based?](https://www.gyrohosting.com/en/knowledgebase/article/serverless-or-node-based-containers)
- [Autoscaling and alerts](https://www.gyrohosting.com/en/knowledgebase/article/gyro-containers-autoscaling-and-alerts)
