---
sidebar_label: What are scopes?
toc_max_heading_level: 3
doc_id: f3a7e1d2-8b4c-4e9f-a2d1-6c8b3f5e7a90
description: >-
  Learn what scopes are in nullplatform, how they relate to applications,
  and how their lifecycle works.
keywords:
  - scopes
  - deployment environments
  - scope lifecycle
  - nullplatform
---

# What are scopes?

A scope is an isolated deployment environment where your application runs. Think of it as the infrastructure behind a specific environment — like production, staging, or a temporary preview for a feature branch.

Each application in nullplatform can have multiple scopes. This lets you deploy the same application to different environments, regions, or configurations without duplicating anything in your codebase.

## How scopes relate to applications

Scopes live under applications in the nullplatform resource hierarchy:

```
Organization → Account → Namespace → Application → Scope
```

When you create a scope for an application, nullplatform provisions the infrastructure needed to run it. Once the scope is active, you can deploy builds to it, route traffic, and manage configuration — all from the same platform.

For more on how this hierarchy works, see [NRN (Nullplatform Resource Name)](/docs/NRN).

## What you can do with scopes

Scopes are flexible by design. Here are some common ways teams use them:

- **Separate environments** — create scopes for development, staging, and production
- **Distribute across regions** — deploy the same app to different geographic locations
- **Isolate workloads** — separate read-heavy from write-heavy traffic
- **Rightsize infrastructure** — allocate different resources to different scopes
- **Preview changes** — spin up temporary scopes for feature branches

You can create as many scopes as you need. Combine these patterns to match your infrastructure strategy.

## Scope lifecycle

Every scope goes through a series of states as it's created, used, and eventually removed.

```mermaid
stateDiagram-v2
    [*] --> pending
    pending --> creating
    creating --> active
    creating --> failed
    active --> updating
    updating --> active
    active --> stopping
    stopping --> stopped
    stopped --> active
    active --> deleting
    stopped --> deleting
    deleting --> deleted
    failed --> recreating
    recreating --> active
    recreating --> failed
    deleted --> [*]
```

| State | What it means |
|-------|---------------|
| **pending** | The scope has been requested but provisioning hasn't started yet |
| **creating** | Cloud resources are being provisioned |
| **active** | The scope is ready — you can deploy to it and route traffic |
| **updating** | Configuration changes are being applied |
| **stopping** | Resources are being scaled down (not destroyed) |
| **stopped** | The scope is suspended. Resources are paused but can be restarted |
| **deleting** | Cloud resources are being torn down |
| **deleted** | The scope has been fully removed |
| **failed** | Something went wrong during provisioning or deletion |
| **recreating** | A previously failed scope is being re-provisioned |

:::note
Only Kubernetes-based scopes can be recreated from a `failed` state. Other scope types need to be deleted and created again.
:::

## Public and private scopes

When you create a scope, you choose whether it's **public** or **private**:

- **Public scopes** are accessible from the internet. Use these for user-facing applications that receive external traffic.
- **Private scopes** can only be reached by other applications inside your account. This is the right choice for internal services, APIs consumed only by other apps, and backend workers.

:::tip
Start with private scopes unless your application needs to receive direct traffic from the internet.
:::

## Next steps

- [Scope types](/docs/agent-backed-scopes/scope-types): see all available scope types and choose between them.
- [Containers](/docs/agent-backed-scopes/containers): the default scope type for Kubernetes workloads.
- [Scope configurations](/docs/agent-backed-scopes/scope-configurations): manage scope settings from the UI using providers.
- [Scheduled tasks](/docs/agent-backed-scopes/scheduled-tasks): run periodic jobs on Kubernetes using CronJobs.
- [Static files](/docs/agent-backed-scopes/static-files): deploy SPAs and static websites with CDN distribution.
