|
1
|
export const metadata = { |
|
2
|
title: `Access Deployment`, |
|
3
|
} |
|
4
|
|
|
5
|
# {metadata.title} |
|
6
|
|
|
7
|
In this guide, you'll learn how to access your Cloud [deployment](../page.mdx) for an environment. |
|
8
|
|
|
9
|
## Access Live Deployment |
|
10
|
|
|
11
|
You can only access a deployment of an [environment](../../environments/page.mdx) once its status is "Live". A live deployment means that your Medusa application is successfully built and is publicly accessible. You can't access previous deployments or deployments that are still in the "Building" or "Failed" status. |
|
12
|
|
|
13
|
You can access the live deployment's Medusa Admin, send requests to its API routes, and access its storefront (if applicable) using the deployment's environment URL. |
|
14
|
|
|
15
|
--- |
|
16
|
|
|
17
|
## Find Backend and Admin's URL |
|
18
|
|
|
19
|
<Note> |
|
20
|
|
|
21
|
For preview environments, refer to the [Preview Environments](../../environments/preview/page.mdx#access-deployed-preview-environment) guide to find the URL of the preview environment. |
|
22
|
|
|
23
|
</Note> |
|
24
|
|
|
25
|
An environment's backend URL is in the format `<subdomain>.medusajs.app`, where `<subdomain>` is the subdomain you set either when [creating its project](../../projects/page.mdx#create-a-project) or when [creating the environment](../../environments/long-lived/page.mdx#create-a-long-lived-environment-on-cloud). |
|
26
|
|
|
27
|
You can also find the URL of a deployment's backend through the Cloud dashboard: |
|
28
|
|
|
29
|
1. If you're in a different organization, [switch to the organization](../../organizations/page.mdx#switch-organization). |
|
30
|
2. Click **Projects** in the sidebar and select the project that contains the environment you want to view. |
|
31
|
3. In the project's dashboard, find the backend URL in the environment's card under the "Backend" title. You can copy the URL by clicking the copy icon next to it. |
|
32
|
|
|
33
|
### Access the Deployment's Medusa Admin |
|
34
|
|
|
35
|
To access the Medusa Admin of a live deployment, click on [the environment's URL](#find-backend-and-admins-url), or navigate to `<environment-url>/app`. For example, if your environment's URL is `my-project.medusajs.app`, navigate to `my-project.medusajs.app/app`. |
|
36
|
|
|
37
|
You can then log in with your Cloud account by clicking the "Log in with Medusa Cloud" button. Medusa creates a user in the Medusa application with the same email as your Cloud account. |
|
38
|
|
|
39
|
 |
|
40
|
|
|
41
|
### Can't Find the Log in with Medusa Cloud Button? |
|
42
|
|
|
43
|
If you don't see the "Log in with Medusa Cloud" button on the Medusa Admin log in page, make sure that: |
|
44
|
|
|
45
|
- Your Medusa application is using [Medusa v2.12.4 or later](https://github.com/medusajs/medusa/releases/tag/v2.12.4). |
|
46
|
- The `MEDUSA_CLOUD_OAUTH_DISABLED` [environment variable](../../environments/environment-variables/page.mdx) of the environment is set to `false` or isn't set. |
|
47
|
- If you set the [http.authMethodsPerActor](!docs!/learn/configurations/medusa-config#httpauthMethodsPerActor) configuration in `medusa-config.ts`, the `user` actor type's authentication methods include `cloud`. For example: |
|
48
|
|
|
49
|
```ts title="medusa-config.ts" |
|
50
|
module.exports = defineConfig({ |
|
51
|
projectConfig: { |
|
52
|
http: { |
|
53
|
// ... |
|
54
|
authMethodsPerActor: { |
|
55
|
user: ["emailpass", "cloud"], |
|
56
|
}, |
|
57
|
}, |
|
58
|
}, |
|
59
|
}) |
|
60
|
``` |
|
61
|
|
|
62
|
After changing the environment variable, [redeploy the environment](../../environments/long-lived/page.mdx#redeploy-environment) for the change to take effect. After changing `medusa-config.ts`, push the change to the environment's branch to start a new build. |
|
63
|
|
|
64
|
--- |
|
65
|
|
|
66
|
## Send Requests to the Deployed Medusa Backend |
|
67
|
|
|
68
|
You can send requests to a live deployment's Medusa backend using the deployment's [environment URL](#find-backend-and-admins-url). |
|
69
|
|
|
70
|
For example, to check the health of the live deployment, you can send a `GET` request to the `/health` endpoint: |
|
71
|
|
|
72
|
```bash |
|
73
|
curl https://my-project.medusajs.app/health |
|
74
|
``` |
|
75
|
|
|
76
|
Where `https://my-project.medusajs.app` is the URL of the environment's Medusa backend. |
|
77
|
|
|
78
|
--- |
|
79
|
|
|
80
|
## Access Deployment's Server through SSH |
|
81
|
|
|
82
|
Medusa doesn't support SSH access to the server instance of a deployment. However, you can still access the server's [runtime and build logs](../../logs/page.mdx) to debug issues in your application. |
|
83
|
|
|
84
|
If this isn't sufficient for your use case, you can contact support to discuss alternatives. |
|
85
|
|
|
86
|
--- |
|
87
|
|
|
88
|
## Find Storefront URL |
|
89
|
|
|
90
|
If you deployed a storefront alongside your Medusa backend, you can access it using the storefront URL. |
|
91
|
|
|
92
|
By default, storefronts are deployed at the `medusajs.site` subdomain. The domain prefix is the same as the Medusa backend's subdomain. For example, if your backend is at `my-store.medusajs.app`, your storefront will be at `my-store.medusajs.site`. |
|
93
|
|
|
94
|
You can find the storefront URL: |
|
95
|
|
|
96
|
1. If you're in a different organization, [switch to the organization](../../organizations/page.mdx#switch-organization). |
|
97
|
2. Click **Projects** in the sidebar and select the project that contains the environment you want to view. |
|
98
|
3. In the project's dashboard, find the storefront URL in the environment's card under the "Storefront" title. You can copy the URL by clicking the copy icon next to it. |
|
99
|
|
|
100
|
You can also set up a custom domain for your storefront. Learn more in the [Custom Domains](../../environments/custom-domains/page.mdx) guide. |