Files
medusa-store/www/apps/book/app/deployment/page.mdx
Shahed Nasser 327e446974 docs: general fixes and overall changes (#7258)
* editing halfway

* edited second half

* adjust starter steps

* fix build

* typo fix
2024-05-07 18:00:28 +02:00

102 lines
4.4 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
export const metadata = {
title: `${pageNumber} Deployment Overview`,
}
# {metadata.title}
In this chapter, youll learn about the different methods to deploy your Medusa application.
## Medusa Project Components
A standard Medusa project is made up of:
- Medusa application: The Medusa server and the Medusa Admin.
- One or more storefronts
![Diagram showcasing the connection between the three deployed components](https://res.cloudinary.com/dza7lstvk/image/upload/v1708600807/Medusa%20Book/deployment-options_ceuuvo.jpg)
You can either deploy the Medusa application fully (server along with the admin), or deploy the Medusa Admin separately. As for the storefront, it's always deployed separately.
---
## Deploying the Medusa Server
You must deploy the Medusa server before the admin or storefront, as both of them connect to it and wont work without a deployed Medusa server URL.
![Diagram showcasing how the Medusa server and its associated services would be deployed](https://res.cloudinary.com/dza7lstvk/image/upload/v1708600972/Medusa%20Book/backend_deployment_pgexo3.jpg)
Since the Medusa server is a Node.js server, it must be deployed to a hosting provider that supports deploying servers, such as Railway, DigitalOcean, AWS, Heruko, etc…
<Note title="Tip">
For optimal experience, make sure that the hosting provider and plan offer at least 2GB of RAM.
</Note>
Your server connects to PostgreSQL and Redis databases. Most hosting providers support deploying and managing these databases along with your Medusa server (such as Railway and DigitalOcean). You can also choose a separate hosting for either of them and connect to them with Medusas configurations.
Refer to [this reference](!resources!/deployment) to find how-to deployment guides for specific hosting providers.
---
## Deploying the Medusa Admin
<Note type="soon" title="Development Notice">
Admin deployment details are still in the work.
</Note>
### Deploy Admin with the Server
Since the Medusa Admin is a plugin installed in the server, you may choose to host them together.
In this scenario, make sure the hosting provider and plan of your choice provide at least 2GB of RAM, as the admin build requires high RAM usage.
![Diagram showcasing how the admin would be deployed along with the Medusa server.](https://res.cloudinary.com/dza7lstvk/image/upload/v1708601021/Medusa%20Book/admin_deployment_1_lyg4cp.jpg)
<Note title="Tip">
The server deployment guides mention details on how to deploy the admin along with the backend.
</Note>
### Deploy Admin through GitHub Action
If you host your server's code on GitHub, you can:
1. Disable the `autoRebuild` option of the admin plugin.
2. Create a GitHub action that builds the admin before the deployment is triggered.
With this solution, you can deploy the admin with the server but the hosting provider doesnt handle the admin building, decreasing the RAM usage.
![Diagram showcasing how the admin can be built through a GitHub action before deployment](https://res.cloudinary.com/dza7lstvk/image/upload/v1708601239/Medusa%20Book/admin_deployment_1_-_actions_cxjv6h.jpg)
### Deploy Admin Separately
You can deploy the admin into a separate hosting provider or instance. The admin can be hosted on providers that support front-end websites and frameworks, such as Vercel.
<Note title="Important">
Per Vercels [license and plans](https://vercel.com/pricing), their free plan can only be used for personal, non-commercial projects. So, you can deploy the Medusa Admin on the free plan for development purposes, but for commercial projects, you must update your Vercel plan.
</Note>
Refer to [this reference](!resources!/deployment) to find how-to deployment guides for specific hosting providers.
---
## Deploying the Storefront
The storefront is deployed separately from the Medusa application, and the hosting options depend on the tools and frameworks you use to create the storefront.
If youre using the Next.js starter, you may deploy the storefront to any hosting provider that supports frontend frameworks, such as Vercel.
<Note title="Important">
Per Vercels [license and plans](https://vercel.com/pricing), their free plan can only be used for personal, non-commercial projects. So, you can deploy the storefront on the free plan for development purposes, but for commercial projects, you must update your Vercel plan.
</Note>
Refer to [this reference](!resoureces!/deployment) to find how-to deployment guides for specific hosting providers.