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
Copy file name to clipboardExpand all lines: docusaurus/docs/dev-docs/installation/cli.md
+32Lines changed: 32 additions & 0 deletions
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:
You will also need to [install `git`](https://github.com/git-guides/install-git) and to have a [GitHub](https://github.com) account to deploy your project to Strapi Cloud.
23
21
:::
24
22
25
23
## 🚀 Part A: Create a new project with Strapi
@@ -29,34 +27,53 @@ We will first create a new Strapi project on your machine by running a command i
29
27
Follow the steps below by clicking on the togglable content to read more instructions.
30
28
31
29
<detailsstyle={detailsStyle}>
32
-
<summarystyle={summaryStyle}>Step 1: Run the installation script</summary>
30
+
<summarystyle={summaryStyle}>Step 1: Run the installation script and create a Strapi Cloud account</summary>
33
31
34
-
### Step 1: Run the installation script
32
+
### Step 1: Run the installation script and create a Strapi Cloud account
2. The terminal will invite you to create a Strapi Cloud account and start a free, 14-day trial. Ensure `Login/Sign up` is selected in the terminal, or use arrow keys to selectit, and press Enter.
57
+
58
+
3. In the new browser tab that opens, ensure the confirmation code is the same as in the terminal and click **Confirm**.
59
+
60
+
4. Still in the browser tab, click **Continue with GitHub**. If you are not already logged in into GitHub with your current browser session, you might be redirected to a GitHub login page.
53
61
54
-
</TabItem>
62
+
5. Once logged in, the browser will display a "Congratulations, you're all set!" message and you can safely close the browser tab and get back to the terminal.
As you will see in the terminal, your project is now building locally and also getting ready to be deployed on Strapi Cloud later.
57
73
58
74
:::info
59
-
The `quick start` installation sets up Strapi with a SQLite database. Other databases and installation options are available (see [CLI installation guide](/dev-docs/installation/cli)).
75
+
* The `quick start` installation sets up Strapi with a SQLite database. Other databases and installation options are available (see [CLI installation guide](/dev-docs/installation/cli)).
76
+
* The folder of your project will include a `.strapi-cloud.json` file used to link the local Strapi project on your machine to the Strapi Cloud project.
60
77
:::
61
78
62
79
</details>
@@ -95,7 +112,7 @@ The admin panel of a local Strapi project runs at [http://localhost:1337/admin](
95
112
First we will build a data structure foryour content. This can only be done whilein development mode, which is the default mode for projects that are created locally.
96
113
97
114
:::tip TIP
98
-
If the server is not already running, in your terminal, `cd` into the `my-project` folder and run `npm run develop` (or `yarn develop`) to launch it.
115
+
If the server is not already running, in your terminal, `cd` into the `my-strapi-project` folder and run `npm run develop` (or `yarn develop`) to launch it.
99
116
:::
100
117
101
118
The Content-Type Builder helps you create your data structure. When creating an empty project with Strapi, this is where to get the party started!
@@ -166,71 +183,55 @@ You have just created a basic data structure for your Strapi project! You can ke
166
183
167
184
## ☁️ Part C: Deploy to Strapi Cloud
168
185
169
-
Now that your beautiful first Strapi project is working locally, it's time for the world to see it live! The most straightforward way to host your project is to use Strapi Cloud. Before deploying to Strapi Cloud, you will need to host your Strapi project on an online repository — we will use GitHub.
186
+
Now that your beautiful first Strapi project is working locally, it's timefor the world to see it live! The most straightforward way to host your project is to use Strapi Cloud: Deploying your project on Strapi Cloud is done with a single command! 🚀
170
187
171
-
<detailsstyle={detailsStyle}>
172
-
<summarystyle={summaryStyle}>Step 1: Host the code of your Strapi project on GitHub</summary>
188
+
To deploy your project on Strapi Cloud, in your terminal:
173
189
174
-
### Step 1: Host the code of your Strapi project on GitHub
190
+
1. If the server for your local Strapi project is running, which should be the caseif you followed this tutorial so far, press `Ctrl-C` to stop the server.
191
+
2. Ensure you are in the folder of your Strapi project (if needed, run for instance `cd my-strapi-project` to reach this folder), and run the following command:
175
192
176
-
Create a new GitHub repository and push the code of your Strapi project to this repository. If you're not already familiar with GitHub, the togglable content below should get you started 👇
193
+
<Tabs groupId="yarn-npm">
177
194
178
-
<details>
179
-
<summary>Steps required to push your Strapi project code to GitHub:</summary>
195
+
<TabItem value="yarn" label="Yarn">
180
196
181
-
1. In the terminal, ensure you are still in the `my-project` folder that hosts the Strapi project we created. If you followed this tutorial closely so far, we should still be there.
182
-
2. Run the `git init` command to initialize git for this folder.
183
-
3. Run the `git add .` command to add all modified files to the git index.
184
-
4. Run the `git commit -m "Initial commit"` command to create a commit with all the added changes.
185
-
5. Log in into 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.
186
-
6. Go back to the terminal and push your local repository to GitHub:
197
+
```sh
198
+
yarn strapi deploy
199
+
```
187
200
188
-
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 actual GitHub profile name, and `my-first-strapi-project` by the actual name you used at step 4.
201
+
</TabItem>
189
202
190
-
b. Run the `git push --set-upstream origin main` command to finally push the commit to your GitHub repository.
203
+
<TabItem value="npm" label="NPM">
191
204
192
-
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).
205
+
```sh
206
+
npm run strapi deploy
207
+
```
193
208
194
-
</details>
209
+
</TabItem>
195
210
196
-
</details>
197
-
198
-
<detailsstyle={detailsStyle}>
199
-
<summarystyle={summaryStyle}>Step 2: Create a Strapi Cloud account and a new Strapi Cloud project</summary>
200
-
201
-
### Step 2: Create a Strapi Cloud account and a new Strapi Cloud project
211
+
</Tabs>
202
212
203
-
To create a new Strapi Cloud account:
213
+
Within a few moments, your local project will be hosted on Strapi Cloud. 🚀
204
214
205
-
1. Navigate to the [Strapi Cloud](https://cloud.strapi.io) login page.
206
-
2. Click the **Continue with GitHub** button and log in with the GitHub account where your Strapi project's repository is hosted.
215
+
Once it's done, the terminal will provide you a clickable link that starts with `https://cloud.strapi.io/projects`. Click on the link, or copy and paste it in your browser address bar, to visit the page.
207
216
208
-
You should now see the Strapi Cloud dashboard. This is where you manage your Strapi projects hosted on Strapi Cloud.
209
-
210
-
We will create a new Strapi Cloud project by importing the local Strapi project you have just pushed to a GitHub repository:
217
+
You will see the Strapi Cloud project we've just created, `my-strapi-project`, visible in the Strapi Cloud dashboard. Click the **Visit app** button in the top right corner to access your deployed Strapi project.
3. Scroll down, and in the "Import git repository section", choose the appropriate Account and Repository from the list (for instance, Account: `yourname`, Repository: `my-first-strapi-project`).
223
-
4. Scroll down further, and in the "Setup" section, give your project a Display name (for instance `my-first-strapi-project`) and leave the other options unchanged.
224
-
5. Click **Create project** at the bottom of the page.
225
-
226
-
Your Strapi project should be deployed within minutes. 🚀 Once it's done, you'll be able to log into your deployed Strapi project by clicking the **Visit app** button in the top right corner.
227
-
228
-
</details>
229
-
230
227
:::callout 🥳 CONGRATULATIONS!
231
228
Now your project is hosted on Strapi Cloud and accessible online. You can learn more about Strapi Cloud by reading [its dedicated documentation](/cloud/intro) or proceed to part D to log in into your online Strapi project and add your first data from there.
232
229
:::
233
230
231
+
:::tip
232
+
Feel free to play with the Content-Type Builder even further and add more fields to your content-types or create new content-types. Anytime you make such changes, deploy them again on Strapi Cloud, by running the appropriate `deploy` command, and see your hosted project updated within a few minutes. Magical, isn't it? 🪄
233
+
:::
234
+
234
235
## 📝 Part D: Add content to your Strapi Cloud project with the Content Manager
235
236
236
237
Now that we have created a basic data structure with 2 collection types, "Restaurant" and "Category", and deployed your project to Strapi Cloud, let's use the Cloud to actually add content by creating new entries.
@@ -242,7 +243,7 @@ Now that we have created a basic data structure with 2 collection types, "Restau
242
243
243
244
Now that your Strapi Cloud project is created, let's log in into the project:
244
245
245
-
1. From your [Strapi Cloud dashboard](https://cloud.strapi.io/projects), click the `my-first-strapi-project` project.
246
+
1. From your [Strapi Cloud dashboard](https://cloud.strapi.io/projects), click the `my-strapi-project` project.
246
247
3. Click the **Visit app** button.
247
248
4. In the new page that opens, complete the form to create the first administrator user of this Strapi Cloud project.
248
249
@@ -433,4 +434,5 @@ Now that you know the basics of creating and publishing content with Strapi, we
433
434
434
435
- 👉 learn how to use Strapi's [REST](/dev-docs/api/rest) API to query the content,
435
436
- 👉 learn more about Strapi features by browsing the [User Guide](/user-docs/intro),
437
+
- 👉 learn more about Strapi Cloud projects by reading the [Cloud Documentation](/cloud/intro),
436
438
- 👉 and [customize your Strapi back end](/dev-docs/backend-customization) and [admin panel](/dev-docs/admin-panel-customization) for advanced use cases.
0 commit comments