# Quick start

Create your first Buddy Sandbox from the web interface or the CLI, connect to it, run your project, and open the application on a public URL.

Two ways to get a running Sandbox: UI or CLI.

## In the web interface

Open the **Sandboxes** tab and click **New Sandbox**.

![Creating a new Sandbox](/docs/sandboxes/create-new-sandbox.png.md)

The only thing you have to provide is a name. Everything else is optional at this point: you can point the Sandbox at a repository to fetch, define the endpoints your application is exposed on, add first boot commands, set resources, variables, and tags. All of it is described in [Configuration](/docs/sandboxes/configuration.md), and all of it can be changed later.

Submit the form and the Sandbox boots immediately. You are then redirected to the Sandbox **Terminal** you can type into right away, and with SSH connection details, so you can keep working from your own shell or your IDE - see [Terminal and SSH](/docs/sandboxes/terminal-and-ssh.md).

![Sandbox terminal](/docs/sandboxes/sandboxes-blank-terminal.png.md)

## From the CLI

<Steps>
  <Step title="Install the CLI and log in">
    ```bash
    npm install -g bdy
    bdy login
    ```
  </Step>
  <Step title="Link your project">
    Run this inside your project directory. It connects the folder to a Buddy project, so the Sandbox knows which repository to pull code from:

    ```bash
    bdy proj link
    ```
  </Step>
  <Step title="Create a Sandbox with your app running">
    One command creates the machine, clones the repository into it, installs dependencies, and starts the application:

    ```bash
    bdy sb create -i my-sandbox \
      --fetch \
      --boot-command "npm install" \
      --app-command "npm start" \
      --wait-for-apps
    ```

    `--fetch` pulls the linked project repository.  
    `--boot-command` runs once during setup.  
    `--app-command` defines a long-running application.  
    `--wait-for-apps` blocks until it is up.

    If something fails, the setup log tells you what happened:

    ```bash
    bdy sb logs my-sandbox
    ```
  </Step>
  <Step title="Expose the app on a public URL">
    Add an HTTP endpoint pointing at the port your app listens on:

    ```bash
    bdy sb ep add my-sandbox -e 3000
    bdy sb ep list my-sandbox
    ```

    The second command prints the public address. Open it in a browser - your app is live.

    <Hint type="warning">

    Your application must listen on `0.0.0.0`, not `127.0.0.1`.  
    A server bound to localhost is unreachable through an endpoint.

    </Hint>
  </Step>
  <Step title="Open a shell inside">
    ```bash
    bdy sb connect my-sandbox
    ```

    You are now the `buddy` user with passwordless `sudo`. Install packages, inspect files, run anything.
  </Step>
  <Step title="Stop it and come back later">
    ```bash
    bdy sb stop my-sandbox
    ```

    The disk remains. When you start the Sandbox again, everything is where you left it.

    ```bash
    bdy sb start my-sandbox
    ```
  </Step>
</Steps>

## Next

- [Configuration](/docs/sandboxes/configuration.md)
- [Snapshots](/docs/sandboxes/snapshots.md)
- [Custom domains](/docs/sandboxes/custom-domains.md)
- [Identity](/docs/sandboxes/identity.md)
- [Sandboxes in pipelines](/docs/sandboxes/pipelines.md)


---
Original source: https://buddy.works/docs/sandboxes/quickstart