# Blue-green deployment

Mobingi ALM uses Blue-Green Deployment to achieve zero-downtime deployment of new code. When you click deploy in the code page, it will simply deploy your code.

![](/files/-LEi1FOKxjcmTATKXRAF)

Whenever you click this button, mobingi ALM will initiate deployment on all your servers. It will:

1. Renew the container image
2. Download the code from the repository
3. Create a new container
4. Perform code installation on the container
5. Test the container
6. If successful, direct all new incoming connections to the new container
7. Delete the old container after ten seconds

Firstly, all connections are being sent to the existing container, known as the Blue Container.

<div align="left"><img src="/files/-LEi1S5B9YxxceYLtd9I" alt=""></div>

When code is deployed, a new Green Container containing the new code is started up and the installation process begins inside it.<br>

<div align="left"><img src="/files/-LEi1YvRrpOuBO4ADy_c" alt=""></div>

Once it is ready, all traffic is then redirected to this new container. While existing connections continue to stay open against the old Blue Container.

<div align="left"><img src="/files/-LEi1nkaLfk5K6Fbk689" alt=""></div>

After 10 seconds, which is enough for most HTTP requests to complete, the Blue Container is shut down, and the Green Container will be considered the Blue Container for the next deployment.

<div align="left"><img src="/files/-LEi1tepqky9cfL0e8sl" alt=""></div>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.alphaus.cloud/v2.0-english/guides-and-tutorials/others/blue-green-deployment.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
