You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Strapi Cloud comes with a Command Line Interface (CLI) which allows you to log in and out, and to deploy a local project without it having to be hosted on a remote git repository. The CLI works with both the `yarn` and `npm` package managers.
10
+
11
+
The Cloud CLI is designed as a CLI-only experience, meaning that users who wish to use Strapi Cloud to deploy their project with the CLI will have to mostly stick to using the CLI (e.g. if you login with the CLI you must logout with the CLI as well, your project deployed with the CLI can only be redeployed with the CLI etc.).
12
+
13
+
:::note
14
+
It is recommended to install Strapi locally only, which requires prefixing all of the following `strapi` commands with the package manager used for the project setup (e.g `npm run strapi help` or `yarn strapi help`) or a dedicated node package executor (e.g. `npx strapi help`).
15
+
:::
16
+
17
+
## strapi login
18
+
19
+
**Alias:**`strapi cloud:login`
20
+
21
+
Log in Strapi Cloud.
22
+
23
+
```bash
24
+
strapi login
25
+
```
26
+
27
+
This command automatically opens a browser window to first ask you to confirm that the codes displayed in both the browser window and the terminal are the same. Then you will be able to log into Strapi Cloud via Google, GitHub or GitLab. Once the browser window confirms successful login, it can be safely closed.
28
+
29
+
If the browser window doesn't automatically open, the terminal will display a clickable link as well as the code to enter manually.
30
+
31
+
## strapi deploy
32
+
33
+
**Alias:**`strapi cloud:deploy`
34
+
35
+
Deploy a new local project (< 100MB) in Strapi Cloud.
36
+
37
+
```bash
38
+
strapi deploy
39
+
```
40
+
41
+
This command must be used after the `login` one. It deploys a local Strapi project on Strapi Cloud, without having to host it on a remote git repository beforehand. The terminal will inform you when the project is successfully deployed on Strapi Cloud.
42
+
43
+
Once the project is first deployed on Strapi Cloud with the CLI, the `deploy` command can be reused to trigger a new deployment of the same project.
44
+
45
+
:::caution
46
+
The `deploy` command can only be used by new users who have never created a Strapi Cloud project, and for which the free trial is still available. Once a project is deployed with the CLI, it isn't possible to deploy another project on the same Strapi Cloud account with the CLI.
47
+
:::
48
+
49
+
:::note
50
+
Once you deployed your project, if you visit the Strapi Cloud dashboard, you may see some limitations as well as impacts due to creating a Strapi Cloud project that is not in a remote repository and which was deployed with the CLI.
51
+
52
+
- Some areas in the dashboard that are usually reserved to display information about the git provider will be blank.
53
+
- Some buttons, such as the **Trigger deploy** button, will be greyed out and unclickable since you can only redeploy your project using the CLI.
54
+
- Options such as environment variables, and features like the logs, are not available for CLI-created projects. <!-- to be confirmed -->
55
+
:::
56
+
57
+
## strapi logout
58
+
59
+
**Alias:**`strapi cloud:logout`
60
+
61
+
Log out of Strapi Cloud.
62
+
63
+
```bash
64
+
strapi logout
65
+
```
66
+
67
+
This command logs you out of Strapi Cloud. Once the `logout` command is run, the terminal will display a confirmation message that you were successfully logged out, and you will not be able to use the `deploy` command anymore.
# Project deployment with the Command Line Interface (CLI)
10
+
11
+
This is a step-by-step guide for deploying your project on Strapi Cloud for the first time, using the Command Line Interface.
12
+
13
+
:::prerequisites
14
+
Before you can deploy your Strapi application on Strapi Cloud using the Command Line Interface, you need to have the following prerequisites:
15
+
16
+
- Be a first-time Strapi Cloud user: you must never have deployed a project with Strapi Cloud before, and your free trial must still be available.
17
+
- Have a Google, GitHub or GitLab account.
18
+
- Have an already created Strapi project (see [Installing from CLI in the Developer Documentation](/dev-docs/installation/cli)), stored locally. The project must be less than 100MB.
19
+
- Have available storage in your hard drive where the temporary folder of your operating system is stored.
20
+
:::
21
+
22
+
## Logging in to Strapi Cloud
23
+
24
+
1. Open your terminal.
25
+
26
+
2. Navigate to the folder of your Strapi project, stored locally on your computer.
27
+
28
+
3. Enter the following command to log into Strapi Cloud:
29
+
30
+
<TabsgroupId="yarn-npm">
31
+
<TabItemvalue="yarn"label="Yarn">
32
+
33
+
```bash
34
+
yarn strapi login
35
+
```
36
+
37
+
</TabItem>
38
+
<TabItemvalue="npm"label="NPM">
39
+
40
+
```bash
41
+
npx run strapi login
42
+
```
43
+
44
+
</TabItem>
45
+
</Tabs>
46
+
47
+
4. In the browser window that opens automatically, confirm that the code displayed is the same as the one written in the terminal message.
48
+
49
+
5. Still in the browser window, choose whether to login via Google, GitHub or GitLab. The window should confirm the successful login soon after.
50
+
51
+
## Deploying your project
52
+
53
+
1. From your terminal, still from the folder of your Strapi project, enter the following command to deploy the project:
54
+
55
+
<TabsgroupId="yarn-npm">
56
+
<TabItemvalue="yarn"label="Yarn">
57
+
58
+
```bash
59
+
yarn strapi deploy
60
+
```
61
+
62
+
</TabItem>
63
+
<TabItemvalue="npm"label="NPM">
64
+
65
+
```bash
66
+
npx run strapi deploy
67
+
```
68
+
69
+
</TabItem>
70
+
</Tabs>
71
+
72
+
2. Follow the progression bar in the terminal until confirmation that the project was successfully deployed with Strapi Cloud.
73
+
74
+
## ⏩ What to do next?
75
+
76
+
Now that you have deployed your project via the Command Line Interface, we encourage you to explore the following ideas to have an even more complete Strapi Cloud experience:
77
+
78
+
- Fill in your [billing information](/cloud/account/account-billing) to prevent your project from being suspended at the end of the trial period.
79
+
- Visit the Cloud dashboard to follow [insightful metrics and information](/cloud/projects/overview) on your Strapi project.
80
+
- Check out the full [Command Line Interface documentation](/cloud/cli/cloud-cli) to learn about the other commands available.
You have 2 options to deploy your project with Strapi Cloud:
12
+
13
+
- either with the user interface (UI), meaning that you will perform all the actions directly on the Strapi Cloud dashboard,
14
+
- or using the Cloud Comment Line Interface (CLI), meaning that you will only interact with a terminal.
15
+
16
+
The guides below will guide you through all the steps for each of the deployment options.
17
+
18
+
<CustomDocCardsWrapper>
19
+
<CustomDocCardemoji="🖼️"title="Via the Cloud dashboard"description="Step-by-step guide to create and deploy a project via the user interface."link="/cloud/getting-started/deployment" />
20
+
<CustomDocCardemoji="💻"title="Via the CLI"description="Step-by-step guide to create and deploy a project with the Cloud Command Line Interface."link="/cloud/getting-started/deployment-cli" />
This is a step-by-step guide for creating and deploying your first project on Strapi Cloud.
11
+
This is a step-by-step guide for deploying your project on Strapi Cloud for the first time, using the Cloud dashboard.
12
12
13
13
:::prerequisites
14
-
Before you can deploy your Strapi application on Strapi Cloud, you need to have the following prerequisites:
14
+
Before you can deploy your Strapi application on Strapi Cloud using the Cloud dashboard, you need to have the following prerequisites:
15
15
16
16
* Strapi version `4.8.2` or higher
17
17
* Project database must be compatible with PostgreSQL. Strapi does not support and does not recommend using any external databases, though it's possible to configure one (see [advanced database configuration](/cloud/advanced/database)).
@@ -33,7 +33,7 @@ Before you can deploy your Strapi application on Strapi Cloud, you need to have
33
33
}}
34
34
/>
35
35
36
-
## Creating a project
36
+
## Deploying a project
37
37
38
38
1. From the *Projects* page, click the **Create project** button.
39
39
@@ -45,7 +45,7 @@ Before you can deploy your Strapi application on Strapi Cloud, you need to have
45
45
}}
46
46
/>
47
47
48
-
2. You will be redirected to the first project creation interface. This interface contains 3 steps: choosing a plan, connecting a git repository, and setting up the project.
48
+
2. You will be redirected to the first project deployment interface. This interface contains 3 steps: choosing a plan, connecting a remote git repository, and setting up the project.
49
49
50
50
<ThemedImage
51
51
alt="Strapi Cloud project creation, step 1"
@@ -58,12 +58,12 @@ Before you can deploy your Strapi application on Strapi Cloud, you need to have
58
58
3. Choose a plan for your Strapi Cloud project: either Developer, Pro, Team, or the 14-days free trial. Feel free to refer to [Pricing](https://strapi.io/pricing-cloud) for more information.
59
59
60
60
:::note
61
-
Strapi Cloud offers a free trial for only one project and you will not need to share your credit card details to create your first project. Once the free trial has already been used for a previous project, the option will no longer appear in the plan selection.
61
+
Strapi Cloud offers a free trial for only one project and you will not need to share your credit card details to deploy your first project. Once the free trial has already been used for a previous project, the option will no longer appear in the plan selection.
62
62
:::
63
63
64
64
4. Connect a git repository to your new Strapi Cloud project.
65
65
66
-
:::strapi Choose your path to create your new Strapi Cloud project!
66
+
:::strapi Choose your path for your new Strapi Cloud project!
67
67
Select one of the tabs below depending on how you wish to proceed:
68
68
- by using a prebuilt template and creating a new repository on GitHub to discover Strapi Cloud easily and quickly *(recommended for new users and beginners — not available on another provider than GitHub)*,
69
69
- or by using your own, already existing GitHub or GitLab repository and Strapi project.
@@ -73,7 +73,7 @@ Before you can deploy your Strapi application on Strapi Cloud, you need to have
4.a. Click on the **Use template** button. If you are creating a project for the first time, you may first have to select GitHub as git provider and then you will see the option to use a template.
76
+
4.a. Click on the **Use template** button. If you are deploying a project for the first time, you may first have to select GitHub as git provider and then you will see the option to use a template.
77
77
78
78
4.b. In the *Create repository with template* modal, choose:
79
79
@@ -93,7 +93,7 @@ Before you can deploy your Strapi application on Strapi Cloud, you need to have
93
93
94
94
4.d. If you have already given Strapi Cloud access to all repositories of your GitHub account, go directly to the next step. If not, you will be redirected to a GitHub modal where you will have to allow Strapi Cloud access to the newly created repository (more information in the [GitHub documentation](https://docs.github.com/en/apps/overview)).
95
95
96
-
4.e. Back in the project creation interface, select your *Account* and the *Repository* you just created.
96
+
4.e. Back in the project deployment interface, select your *Account* and the *Repository* you just created.
97
97
98
98
<ThemedImage
99
99
alt="Selecting GitHub account and repository"
@@ -107,15 +107,15 @@ Before you can deploy your Strapi application on Strapi Cloud, you need to have
4.a. (optional) If you are creating a project for the first time, you may first have to select a git provider: either GitHub or GitLab. If you already created a project with one git provider, you can afterward create another project using another provider by clicking on the **Switch git provider** button and selecting either GitHub or GitLab.
110
+
4.a. (optional) If you are deploying a project for the first time, you may first have to select a git provider: either GitHub or GitLab. If you already deployed a project with one git provider, you can afterward deploy another project using another provider by clicking on the **Switch git provider** button and selecting either GitHub or GitLab.
111
111
112
112
:::tip
113
113
Connect the GitHub or GitLab account and/or organizations that own the repository or repositories you want to deploy. This can be different from the account that owns the Strapi Cloud account.
114
114
:::
115
115
116
116
4.b. If you have already given Strapi Cloud access to all repositories of your GitHub or GitLab account, go directly to the next step. If not, you will be redirected to a modal where you will have to allow Strapi Cloud permission to access some or all your repositories on GitHub/GitLab (more information in the [GitHub](https://docs.github.com/en/apps/overview) and [GitLab](https://docs.gitlab.com/ee/integration/oauth_provider.html#view-all-authorized-applications) documentations).
117
117
118
-
4.c. Back in the project creation interface, select your *Account* and a *Repository*.
118
+
4.c. Back in the project deployment interface, select your *Account* and a *Repository*.
119
119
120
120
<ThemedImage
121
121
alt="Selecting git account and repository"
@@ -176,7 +176,7 @@ During the free trial, will be kept informed of the number of remaining free day
176
176
👉 Skip to step 5 of the section below to finalise the creation of your project.
177
177
:::
178
178
179
-
1. Click on the **Continue to billing** button. You will directly be redirected to the second and final project creation interface. There you can review all your new project setup information, enter payment & billing details and receive your invoice.
179
+
1. Click on the **Continue to billing** button. You will directly be redirected to the second and final project deployment interface. There you can review all your new project setup information, enter payment & billing details and receive your invoice.
180
180
181
181
<ThemedImage
182
182
alt="Payment & Billing"
@@ -192,8 +192,16 @@ During the free trial, will be kept informed of the number of remaining free day
192
192
193
193
4. Check your invoice which informs you of what should be paid now and the following month. Optionally, you can enter a *Discount code* if you have one.
194
194
195
-
5. Click on the **Create project** button to finalize the creation of your new Strapi Cloud project. An initial deployment will automatically be triggered and you will be redirected to the *Projects* page.
195
+
5. Click on the **Create project** button to finalize the deployment of your new Strapi Cloud project. An initial deployment will automatically be triggered and you will be redirected to the *Projects* page.
196
196
197
197
:::caution
198
198
Create your Admin user after the initial deployment is complete. Do not share your application URL with anyone until you have created your Admin user.
199
199
:::
200
+
201
+
## ⏩ What to do next?
202
+
203
+
Now that you have deployed your project via the Cloud dashboard, we encourage you to explore the following ideas to have an even more complete Strapi Cloud experience:
204
+
205
+
- If you chose the free trial during your first project deployment, make sure to fill in your [billing information](/cloud/account/account-billing) afterward to prevent your project from being suspended at the end of the trial period.
206
+
- Invite other users to [collaborate on your project](/cloud/projects/collaboration).
207
+
- Check out the [deployments management documentation](/cloud/projects/deploys) to learn how to trigger new deployments for your project.
Copy file name to clipboardExpand all lines: docusaurus/docs/dev-docs/installation/cli.md
+32
Original file line number
Diff line number
Diff line change
@@ -79,6 +79,8 @@ The above installation guide only covers the basic installation option using the
79
79
- `--typescript`/`--ts`: Create a project in [TypeScript](/dev-docs/typescript).
80
80
- `--no-run`: Prevent Strapi from automatically starting the server (useful in combination with `--quickstart`).
81
81
82
+
- `--skip-cloud`: Automatically answers "Skip" to the Login/Signup question, which prevents the installation script from login into Strapi Cloud (useful in combination with `--quickstart`).
83
+
82
84
For more information on available flags, see our [CLI documentation](/dev-docs/cli).
83
85
84
86
Strapi also offers a starters CLI to create a project with a pre-made frontend application (see [our dedicated blog post](https://strapi.io/blog/announcing-the-strapi-starter-cli)).
@@ -89,6 +91,36 @@ Experimental Strapi versions are released every Tuesday through Saturday at midn
89
91
Please use these experimental builds at your own risk. It is not recommended to use them in production.
90
92
:::
91
93
94
+
### Skipping the Strapi Cloud login step
95
+
96
+
When the installation script runs, the terminal will first ask you if you want to login/signup. Choosing `Login/signup` will create a free, 14-day trial [Strapi Cloud](/cloud/intro#what-is-strapi-cloud) project as described in the [Quick Start Guide](/dev-docs/quick-start).
97
+
98
+
If you prefer skipping this Strapi Cloud login part, use the arrow keys to select `Skip`. The script will resume and create a local project. To deploy this project and host it online, you could later choose to:
99
+
- host it yourself by pushing the project's code to a repository (e.g., on GitHub) before following a [3rd-party deployment guide](/dev-docs/deployment),
100
+
- or use the [Cloud CLI](/cloud/cli/cloud-cli) commands to login to Strapi Cloud and deploy your project there.
101
+
102
+
If you want to host your project yourself and are not already familiar with GitHub, the following togglable content should get you started👇.
103
+
104
+
<details>
105
+
<summary>Steps required to push your Strapi project code to GitHub:</summary>
106
+
107
+
1. In the terminal, ensure you are still in the folder that hosts the Strapi project you created.
108
+
2. Run the `git init`command to initialize git for this folder.
109
+
3. Run the `git add .`command to add all modified files to the git index.
110
+
4. Run the `git commit -m "Initial commit"`command to create a commit with all the added changes.
111
+
5. Log in to your GitHub account and [create a new repository](https://docs.github.com/en/repositories/creating-and-managing-repositories/quickstart-for-repositories). Give the new repository a name, for instance `my-first-strapi-project`, and remember this name.
112
+
6. Go back to the terminal and push your local repository to GitHub:
113
+
114
+
a. Run a command similar to the following: `git remote add origin [email protected]:yourname/my-first-strapi-project.git`, ensuring you replace `yourname` by your own GitHub profile name, and `my-first-strapi-project` by the actual name you used at step 4.
115
+
116
+
b. Run the `git push --set-upstream origin main`command to finally push the commit to your GitHub repository.
117
+
118
+
Additional information about using git with the command line interface can be found in the [official GitHub documentation](https://docs.github.com/en/migrations/importing-source-code/using-the-command-line-to-import-source-code/adding-locally-hosted-code-to-github#adding-a-local-repository-to-github-using-git).
119
+
120
+
</details>
121
+
122
+
123
+
92
124
## Running Strapi
93
125
94
126
To start the Strapi application, run the following commandin the project folder:
0 commit comments