www/apps/cloud/app/projects/page.mdx
import { Note, Prerequisites, InlineIcon, getOsShortcut, Kbd } from "docs-ui" import { ChevronUpDown } from "@medusajs/icons"
export const metadata = {
title: Create Projects and Deploy to Cloud,
}
In this guide, you'll learn about projects, how to create them, view their details, and manage their settings in Cloud.
A project is the collection of resources, environments, deployments, and settings related to a Medusa application deployed to the Cloud. The project is linked to a GitHub repository that hosts the Medusa application's code.
To deploy a Medusa application to the Cloud, you create a project for it. Medusa will automatically set up and configure the necessary resources in the project to run the application, such as PostgreSQL, Redis, and S3.
You can deploy either a Medusa application (server and admin dashboard) only, or a Medusa application along with a storefront.
Each project can have multiple environments, such as production and staging. These environments allow you to test changes before pushing them live to users. You can learn more in the Environments documentation.
If you've reached the limit of projects allowed in your organization's plan, you need to upgrade your plan to create more projects. Learn more in the Plans & Pricing guide.
</Note>In this section, you'll learn how to create a project in Cloud to deploy your Medusa application.
To create a project:
<Note title="Tip">You can also start the project creation flow from the command palette. Press <Kbd>{getOsShortcut()}</Kbd> + <Kbd>K</Kbd>, then select Create Project.
</Note>In the project-creation page, you can either create from a starter or create from an existing application.
Medusa provides you with starter templates that you can use to quickly set up your ecommerce application. All templates include a storefront, backend, and admin dashboard. These templates include:
To create a project from a starter template:
The repository will be cloned, and you'll move forward to the Configure step.
If you already have a Medusa application, you can create a project from it.
Refer to the Prerequisites for Creating Projects guide to ensure your Medusa application meets the necessary prerequisites before deploying it to Cloud. This is especially necessary if you're deploying a storefront along with your Medusa application.
To create a project from an existing Medusa application:
You'll move forward to the Configure step.
After selecting the repository, you'll move on to the project configuration step. You can set the following information:
medusajs.app.
my-project, the project will be accessible at my-project.medusajs.app. Refer to the subdomain restrictions section for more details.my-project.medusajs.site.After creating the project, it will take a few minutes to create the necessary resources for it and deploy it. Once the deployment is complete, you'll be able to access the project from your organization's dashboard.
<Note>If the project creation takes too long, check out the troubleshooting section.
</Note>If you click on the project, you'll be taken to the project's dashboard, where you can view its details and status.
Once the project is created and deployed, you'll receive a notification in the Cloud dashboard. You can also view its status in the list of projects and in the project's details.
If you encounter any issues while creating a project, check common deployment issues and their solutions
<Note>If the issue isn't related to your application, check the Cloud status page for ongoing Cloud incidents that may be affecting project creation.
</Note>Your backend's URL must be a subdomain of medusajs.app. For example, if you choose my-store as your subdomain, your project's URL will be my-store.medusajs.app.
When you choose a subdomain for your project, it must be at least five characters long. It also can't be one of the following reserved subdomains:
medusaadminstagingproductionpreviewdevelopmentproxyIf you also deployed a storefront with your Medusa application, its URL will be a subdomain of medusajs.site. For example, if your backend's subdomain is my-store, your storefront's URL will be my-store.medusajs.site. You can also add a custom domain, as explained in the Custom Domains guide.
Medusa supports hosting your Medusa projects on Cloud in the following regions:
us-east-1)eu-central-1)ap-southeast-1)All your project's deployments will be in the selected region. For better performance, choose a region that's closer to your target users. If you need to host your Medusa project in a different region, contact support.
To access the deployed project, you can navigate to:
Learn more in the Access Deployment guide.
If you created your project from a starter, Cloud clones the starter's code into a GitHub repository in the account or organization you chose. To customize your store, you clone that repository to your machine and run the application locally.
Learn how to do that in the Clone a Cloud Project Locally guide.
To open a project's dashboard:
When you open a project's dashboard, its name will be shown at the top left next to the organization switcher.
On the project's dashboard, you can view the following details:
The project's name at the top left of the dashboard is also a project switcher.
To switch to a different project:
This will change the view to the selected project, and you'll see its details, environments, and settings.
To view the deployments of a project, click Deployments in the sidebar of the project's dashboard. This will show you a list of all deployments for the project, including their status, environment, and how long the deployment took.
Learn more in the Deployments guide.
If you initially created a project with only a Medusa application and later want to add a storefront to it, you can do it from the organization or project's dashboard.
Before adding a storefront, make sure you've changed your repository structure to a monorepo that includes both the Medusa application and storefront code. Learn how to create the monorepo in the Prerequisites for Creating Projects guide.
Then, to add a storefront to an existing project:
Cloud will then deploy the storefront along with the Medusa application. Once the deployment is complete, you'll be able to access the storefront from the Production environment card in the project's dashboard.
You can also set a custom domain for the storefront, as explained in the Custom Domains guide.
After creating a project, you can edit its general details, such as the project name and root directory in the repository, and manage its preview settings.
To edit a project's general details:
You can also edit a project's preview settings, which are general settings related to Previews environments, by clicking Settings > Preview Settings in the sidebar.
Learn more in the Preview Environments guide.
You can change the GitHub repository connected to your project from the project's general settings page. This is useful if you've moved your Medusa application to a different repository.
To change the connected repository:
The next time you push to the new repository, your project will be built from there.
By default, all your projects use the infrastructure specifications defined in your organization's plan.
In some scenarios, you may have projects that don't require heavy infrastructure specifications, such as a project used for testing or development purposes. In such cases, you can change the infrastructure specifications of a project to use lighter specifications. This can help reduce costs and optimize resource usage.
You can also change the infrastructure specifications of a project to use heavier specifications if your project requires more resources, such as a project with high traffic or complex operations.
To change the infrastructure specifications of a project:
The infrastructure specifications of the project will be updated based on the selected plan.
If you want to revert the infrastructure specifications of a project to use the specifications defined in your organization's plan, you can do so by disabling the "Infrastructure specs" toggle in the Settings > General page.
The project will then use the specifications defined in your organization's plan.
Deleting the storefront is irreversible. This action permanently removes the storefront associated with the project. You can re-add the storefront if needed.
</Note>If your project has a storefront deployed, you can permanently delete it from the project settings.
To delete the storefront:
This will remove your storefront from the project. Future deployments include the backend only.
To delete a project: