<commit_before>---
title: Deploying MicroBOSH
---

The only supported way to deploy BOSH for production is to use MicroBOSH.

MicroBOSH runs within a single VM on any cloud infrastructure that is supported for deploying software with BOSH.
MicroBOSH is suited to deploying BOSH releases of any software, including multi-VM BOSH.

To deploy MicroBOSH you need a stemcell and a manifest.
You do not need a release since MicroBOSH itself is included within the stemcell.

The IaaS you use determines many details of how you deploy MicroBOSH.
This topic starts with a general procedure that applies for all IaaS's,
and ends with an example focused on AWS.

## <a id="prep"></a> Preparing to Deploy  ##

Your overall goal when preparing to deploy MicroBOSH is to have a stemcell, a manifest,
and properly set up environments both locally and in the cloud.

### <a id="cli"></a> Install the BOSH CLI  ###

* Run this command to install the BOSH CLI along with its MicroBOSH plugin:

    `gem install bosh_cli bosh_cli_plugin_micro`

### <a id="cloud"></a> Set up a deployment area in the cloud ###

Collect or decide:

1. The environment name.
1. Any IaaS-specific information about where your deployment should reside.
1. The name and credentials of an admin user for your deployment.

### <a id="local"></a> Set up a local work area  ###

**Note**: While not required, the instructions in this section are highly recommended.

Set up a directory structure with three levels:

1. A top-level directory for each IaaS you plan to use.
1. Inside the IaaS directory, directories for each cloud you intend to deploy on the IaaS.
1. Inside each cloud directory, directories for each product you intend to deploy. In this context, MicroBOSH is a product.

* For example, you might be planning to deploy MicroBOSH on a cloud named `boshtest`, that in turn is deployed to the OpenStack IaaS.
You would create a directory for each, such that the path to your MicroBOSH deployment could be `openstack/boshtest/micro`.

### <a id="stemcell"></a> Obtain a stemcell  ###

[Download](http://bosh-artifacts.cfapps.io/) a stemcell that is appropriate for your preferred combination of IaaS and VM type.
Download to the directory of your choice, and remember its path for later use.

### <a id="enviro"></a> Set up your local environment   ###

In the directory that contains files for your MicroBOSH deployment (`openstack/boshtest/micro` in these examples),
create a text file named `bosh_environment`.

* For each item of information enumerated [above](#cloud),
add a line to the file, of the form:

    `export <BOSH_environment_variable>=<value>`

Use the information you have [collected](#cloud) to identify values to assign.

* Now use the file to generate the BOSH environment variables:

    `source bosh_environment`

* Check to see that the BOSH environment variables exist:

    `env | grep BOSH`

### <a id="manifest"></a> Create the manifest  ###

If you are using an IaaS other than AWS, you need to use a text editor to create a deployment manifest.
Refer to [Creating a BOSH Deployment Manifest](./create-manifest.html) for instructions.

For AWS, there are BOSH CLI commands which generate the manifest for you.

The MicroBOSH deployment manifest is a YAML file named `micro-bosh.yml` and should reside in the directory
named for the product it deploys (`openstack/boshtest/micro` in these examples).

## <a id="deploy"></a> Deploying MicroBOSH  ##

Once preparation is complete, you deploy MicroBOSH in three steps.

### <a id="set"></a> Set the deployment  ###

Before you deploy, you must set the BOSH CLI to use the correct manifest.
This is called "setting the deployment."

1. `cd` into the directory you created for MicroBOSH (`micro` in these examples).
1. Set the deployment:

    `bosh micro deployment micro_bosh.yml`

### <a id="deploy"></a> Deploy MicroBOSH  ###

1. `cd` into the directory you created for MicroBOSH (`micro` in these examples).
1. Deploy MicroBOSH:

    `bosh micro deploy <stemcell_URL>`

## <a id="verify"></a> Verifying your Deployment  ##

You have two general options for verifying that your deployment was successful.
These are:

1. Start using MicroBOSH by targeting the new director and uploading software.
A minimal "dummy release" can be useful here.
<commit_msg>refine wording about early decisions<commit_after>---
title: Deploying MicroBOSH
---

The only supported way to deploy BOSH for production is to use MicroBOSH.

MicroBOSH runs within a single VM on any cloud infrastructure that is supported for deploying software with BOSH.
MicroBOSH is suited to deploying BOSH releases of any software, including multi-VM BOSH.

To deploy MicroBOSH you need a stemcell and a manifest.
You do not need a release since MicroBOSH itself is included within the stemcell.

The IaaS you use determines many details of how you deploy MicroBOSH.
This topic starts with a general procedure that applies for all IaaS's,
and ends with an example focused on AWS.

## <a id="prep"></a> Preparing to Deploy  ##

Your overall goal when preparing to deploy MicroBOSH is to have a stemcell, a manifest,
and properly set up environments both locally and in the cloud.

**Note**: Along with the decision you have made to deploy MicroBOSH,
you should have made a few more decisions:

* What IaaS to use.
* What to name the cloud you plan to deploy on that IaaS.

### <a id="cli"></a> Install the BOSH CLI  ###

* Run this command to install the BOSH CLI along with its MicroBOSH plugin:

    `gem install bosh_cli bosh_cli_plugin_micro`

### <a id="cloud"></a> Set up a deployment area in the cloud ###

Collect or decide:

1. The name of the cloud you plan to deploy.
1. Any IaaS-specific information about where your deployment should reside.
1. The name and credentials of an admin user for your deployment.

### <a id="local"></a> Set up a local work area  ###

**Note**: While not required, the instructions in this section are highly recommended.

Set up a directory structure with three levels:

1. A top-level directory for each IaaS you plan to use.
1. Inside the IaaS directory, directories for each cloud you intend to deploy on the IaaS.
1. Inside each cloud directory, directories for each product you intend to deploy. In this context, MicroBOSH is a product.

* For example, you might be planning to deploy MicroBOSH on a cloud named `boshtest`, that in turn is deployed to the OpenStack IaaS.
You would create a directory for each, such that the path to your MicroBOSH deployment could be `openstack/boshtest/micro`.

### <a id="stemcell"></a> Obtain a stemcell  ###

[Download](http://bosh-artifacts.cfapps.io/) a stemcell that is appropriate for your preferred combination of IaaS and VM type.
Download to the directory of your choice, and remember its path for later use.

### <a id="enviro"></a> Set up your local environment   ###

In the directory that contains files for your MicroBOSH deployment (`openstack/boshtest/micro` in these examples),
create a text file named `bosh_environment`.

* For each item of information enumerated [above](#cloud),
add a line to the file, of the form:

    `export <BOSH_environment_variable>=<value>`

Use the information you have [collected](#cloud) to identify values to assign.

* Now use the file to generate the BOSH environment variables:

    `source bosh_environment`

* Check to see that the BOSH environment variables exist:

    `env | grep BOSH`

### <a id="manifest"></a> Create the manifest  ###

If you are using an IaaS other than AWS, you need to use a text editor to create a deployment manifest.
Refer to [Creating a BOSH Deployment Manifest](./create-manifest.html) for instructions.

For AWS, there are BOSH CLI commands which generate the manifest for you.

The MicroBOSH deployment manifest is a YAML file named `micro-bosh.yml` and should reside in the directory
named for the product it deploys (`openstack/boshtest/micro` in these examples).

## <a id="deploy"></a> Deploying MicroBOSH  ##

Once preparation is complete, you deploy MicroBOSH in three steps.

### <a id="set"></a> Set the deployment  ###

Before you deploy, direct the BOSH CLI to use the correct manifest.
This is called "setting the deployment."

1. `cd` into the directory you created for MicroBOSH (`micro` in these examples).
1. Set the deployment:

    `bosh micro deployment micro_bosh.yml`

### <a id="deploy"></a> Deploy MicroBOSH  ###

1. Recall the local path to the stemcell you downloaded.
1. `cd` into the directory you created for MicroBOSH (`micro` in these examples).
1. Deploy MicroBOSH:

    `bosh micro deploy <local_path_to_stemcell>`

An important effect of this command is to create a file named `bosh-deployment.yml`.
This file functions like a small database that MicroBOSH uses when bootstrapping itself.

in the directory where you run

## <a id="verify"></a> Verifying your Deployment  ##

You have two general options for verifying that your deployment was successful.
These are:

1. Start using MicroBOSH by targeting the new director and uploading software.
A minimal "dummy release" can be useful here.

{'fraction_non_alphanumeric': 0.07570596637732117, 'fraction_numerical': 0.00252719481375673, 'mean_word_length': 4.255196304849885, 'pattern_counts': {'":': 0, '<': 53, '<?xml version=': 0, '>': 53, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4412371', 'n_tokens_mistral': 2631, 'n_tokens_neox': 2518, 'n_words': 1333}