# Launch a sandbox

Source: https://docs.sandboxes.cloud/docs/launch-a-sandbox.md

In this page, we describe how to start a new sandbox with your code and configuration. We will use a simple version of a demo app to illustrate the process.

## Start a sandbox from home page on Web Console

From the home page in Crafting Web Console, we can start a new sandbox right there.

<Image align="center" className="border" border={true} src="https://files.readme.io/ddd3966-guide_create.jpg" />

Clicking the card, there are some options shown in the dialog.

<Image align="center" className="border" width="80% " border={true} src="https://files.readme.io/2695250-guide_create_2.jpg" />

If your organization already defined templates for developers to choose from, it will default to the option of creating a sandbox with a pre-defined template. You can select a template you need and create a sandbox.

You can click the `Create` button on the bottom to launch a sandbox with the default config, or click `Customize` to get to customization page, as shown below.

You can also choose `Create a Workspace` if you don't want to use any pre-defined template. The flow is covered in [Start a Workspace](https://docs.sandboxes.cloud/docs/start-a-workspace).

### Customize checkout

<Image align="center" className="border" border={true} src="https://files.readme.io/5c2ecf8-guide_create_customize_checkout.jpg" />

You can customize with version of the code you want to checkout and run in your sandbox from the customization page. It can be different from the default branch defined in the template to fit different purposes of the sandbox, e.g.,

* For coding a new feature, you can create the sandbox from master, and then do `git checkout -b` to create your own branch in the sandbox
* For previewing, you can select a branch that is recently pushed to the repo (`Recent branch`) or a branch that is corresponding to an open Pull Request (`Open PullRequest`)
* Or you can simply specific a custom branch or tag to checkout code from (`Custom`)

#### Customize environment variables

<Image align="center" className="border" border={true} src="https://files.readme.io/c5b6065-guide_create_customize_env.jpg" />

Another common customization is to override the default environment variables in the sandbox to have your own configuration on top of the template. The buttons highlighted above allows you to customize environment variables on sandbox level (applied to all workspaces) or on individual workspace level. Please see [Environment variables (ENV)](https://docs.sandboxes.cloud/docs/env-management) for details.

#### Customize data snapshots

<Image align="center" className="border" border={true} src="https://files.readme.io/9d59a52-guide_create_customize_data_snapshot.jpg" />

At sandbox launch time, you can also customize which dataset to load into the databases in the sandbox. Your team may have default data snapshots defined in the template for loading the default data set into the dev environments. Here you have the ability to change that for your sandbox.

#### Launching a sandbox

![Launching a sandbox](https://files.readme.io/3387d2b-image.png)

After clicking `Launch` from the customization page (or clicking `Create` directly from the dialog) your new sandbox is launched and the Crafting platform will launch corresponding containers in the sandbox. When it is ready, you can start working on the sandbox (see [Work on a sandbox](https://docs.sandboxes.cloud/docs/work-on-a-sandbox) for details)

### Create a sandbox from other places

Additionally, a developer can create sandbox from several other places:

* From sandbox list page

<Image align="center" className="border" width="80% " border={true} src="https://files.readme.io/f7253a1-image.png" />

* From the template page

<Image align="center" className="border" width="80% " border={true} src="https://files.readme.io/9ec11d1-image.png" />

* Via Crafting command line tool (CLI)

```shell
$ cs sandbox create
```

From the Crafting command line tool, `cs`, you can create a sandbox with detailed customization by specifying command line parameters. Please see [Command Line Tool](https://docs.sandboxes.cloud/docs/command-line-tool#sandbox) for details.

This is also the recommended way for programmatically create a sandbox in your automation workflow. Please see [Git Service Integration for Preview](https://docs.sandboxes.cloud/docs/git-integration) for more description on the use case.

* By clicking a URL from browser

A developer can also create a sandbox by clicking a URL from their browser, e.g.,

```text
https://sandboxes.cloud/create?app=frontend&ws_frontend_co_src_version=master&ws_frontend_mode=auto&dep_mysql_snapshot=mysql-snapshot&autolaunch=true
```

This allows a customized link (usually auto-generated by tools) to be posted in Pull Requests or Slack channels for people to create sandbox with specific configuration, which is commonly in the preview use case. Please see [Git Service Integration for Preview](https://docs.sandboxes.cloud/docs/git-integration) for details.