> For the complete documentation index, see [llms.txt](https://docs.madrix.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.madrix.dev/br/tutoriais-praticos/3.-deploy-e-ambientes-cloud.md).

# 3. Deploy e Ambientes Cloud

### Pré-requisitos

* Seu projeto já roda no **Preview**.
* Você tem permissão para **comprar/provisionar** ambientes (billing).
* (Opcional) Você tem acesso ao **DNS** do domínio, se for usar domínio próprio.

{% hint style="info" %}
**Dev** para testar rápido. **Staging** para validar release. **Prod** para usuários finais.
{% endhint %}

{% stepper %}
{% step %}

### Abra Ambientes Cloud

* [ ] Vá em **Configurações do Projeto → Ambientes Cloud**
  {% endstep %}

{% step %}

### Crie o ambiente

* [ ] Clique em **Purchase Environment**
* [ ] Defina o **nome** do ambiente (ex.: `dev-meuapp`, `staging-meuapp`, `prod-meuapp`)

{% hint style="info" %}
Escolha um nome que deixe o tipo do ambiente óbvio. Evita deploy no lugar errado.
{% endhint %}
{% endstep %}

{% step %}

### Configure domínio e dimensionamento

* [ ] (Opcional) Configure um **domínio** (se você quer URL própria)
* [ ] Configure o **dimensionamento**

{% hint style="info" %}
Comece menor. Aumente depois se houver lentidão, timeout, ou carga real.
{% endhint %}
{% endstep %}

{% step %}

### Provisione e aguarde ficar Ready

* [ ] Prossiga com o provisionamento
* [ ] Aguarde o status ficar **Ready**

<details>

<summary>Tempo esperado</summary>

Normalmente leva alguns minutos. Se ficar parado por muito tempo, siga a seção “Se der errado”.

</details>
{% endstep %}

{% step %}

### Publique (deploy)

* [ ] Clique em **Publicar** e faça o deploy do seu projeto para esse ambiente

{% hint style="info" %}
Evite “spam deploy”. Se precisar, aguarde alguns minutos e tente novamente.
{% endhint %}
{% endstep %}

{% step %}

### Valide o deploy

* [ ] Abra a **URL** do domínio
* [ ] Confirme que a home carrega
* [ ] Faça login e valide um fluxo crítico (ex.: criar/editar um registro)
  {% endstep %}
  {% endstepper %}

### Se der errado

* **Deploy falha com erro:** siga [Problemas de deploy](/br/solucao-de-problemas/problemas-de-deploy.md).
* **Ambiente “Ready”, mas a URL não abre:** se usa domínio próprio, revise DNS e aguarde propagação.
* **Deploy conclui, mas o app não sobe:** trate como problema de **runtime** e siga o diagnóstico no troubleshooting.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.madrix.dev/br/tutoriais-praticos/3.-deploy-e-ambientes-cloud.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
