import InstallPrerequisites from '/docs/snippets/installation-prerequisites.md'
import PushToGitHub from '/docs/snippets/push-to-github.md'
Quick Start Guide#
Build and deploy a Strapi project from scratch in 12 steps: create a local project with create-strapi@latest, define collection types using the Content-Type Builder, push your project to GitHub and deploy to Strapi Cloud from the Cloud dashboard, and add content via the Content Manager.
Strapi offers a lot of flexibility. Whether you want to go fast and quickly see the final result, or would rather dive deeper into the product, we got you covered. For this tutorial, we'll go for the DIY approach and build a project and content structure from scratch, then deploy your project to Strapi Cloud to add data from there.
:::tip Track your progress
This guide is organized into collapsible steps. Click a step's title to expand or collapse it, and click the circle on the right of a step to mark it as completed once you're done. Completed steps turn green, and a progress summary at the bottom-right of the page keeps track of how far along you are.
:::
:::strapi 3 options to discover Strapi
There are 3 options to discover Strapi. Choose what best suits you:
-
Strapi offers a hosted demo so you can quickly try its Content Manager and learn how to edit content. In this hosted demo, Strapi runs in production mode, so the Content-Type Builder is disabled by design.
-
If you want to try a full-fledge application, complete with a Strapi back end, a Next.js front end, and example data, install the LaunchPad application locally.
-
If you want to learn how to start from scratch, follow the present Quick Start Guide.
:::
You will also need to and to have a account to deploy your project to Strapi Cloud.
Part A: Create a new project with Strapi#
We will first create a new Strapi project on your machine by running a command in the terminal, and then register our first local administrator user.
Follow the steps below by clicking on the togglable content to read more instructions.
-
Run the following command in a terminal:
npx create-strapi@latest my-strapi-project -
The terminal will prompt you to log in or sign up. Once you do, a 30-day trial of the plan will be automatically applied to your project. For the purpose of this tutorial, ensure
Login/Sign upis selected in the terminal, or use arrow keys to select it, and press Enter. -
In the new browser tab that opens, ensure the confirmation code is the same as in the terminal and click Confirm.
-
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.
-
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.
<ThemedImage
alt="Login GIF"
sources={{
light: '/img/assets/quick-start-guide/qsg-cloud-login.gif',
dark: '/img/assets/quick-start-guide/qsg-cloud-login.gif',
}}
/> -
The terminal will now ask you a few questions. Press
Enterto accept the default answer to all questions.
As you will see in the terminal, your project is now building locally.
Once the installation is complete, you need to start the server. In the terminal, type or copy and paste the following:
cd my-strapi-project && npm run develop
Your browser automatically opens a new tab.
By completing the form, you create your own account. Once done, you become the first administrator user of this Strapi application. Welcome aboard, commander!
You now have access to the :
<ThemedImage
alt="Admin panel screenshot: dashboard"
sources={{
light: '/img/assets/quick-start-guide/qsg-handson-part1-01-admin_panel-v5.png',
dark: '/img/assets/quick-start-guide/qsg-handson-part1-01-admin_panel-v5_DARK.png',
}}
/>
:::callout Congratulations!
You have just created a new Strapi project! You can start playing with Strapi and discover the Content Manager by yourself, or proceed to part B below.
:::
Part B: Build your content structure with the Content-type Builder#
The installation script has just created an empty project. We will now guide you through creating a small restaurants directory.
The admin panel of a local Strapi project runs at . This is where you will spend most of your time creating and updating content.
First we will build a content structure for your content. This can only be done while in development mode, which is the default mode for projects that are created locally.
The Content-Type Builder helps you create your content structure. When creating an empty project with Strapi, this is where to get the party started!
Your restaurants directory will eventually include many restaurants, so we need to create a "Restaurant" collection type. Then we can describe the fields to display when adding a new restaurant entry:
- Go to in the main navigation on the left of the admin panel.
- Click on the plus icon next to Collection types.
- Type
Restaurantfor the Display name, and click Continue. - Click on the Add new field button, and select the Text field.
- Type
Namein the Name field. - Switch to the Advanced Settings tab, and check the Required field and the Unique field settings.
- Click on Add another field.
- Choose the Rich text (Blocks) field in the list.
- Type
Descriptionunder the Name field, then click Finish. - Finally, click Save and wait for Strapi to restart.
<ThemedImage
alt="GIF: Create Restaurant collection type in Content-type Builder"
sources={{
light: '/img/assets/quick-start-guide/qsg-handson-restaurant-v6-compressed.gif',
dark: '/img/assets/quick-start-guide/qsg-handson-restaurant-v6-compressed_DARK.gif',
}}
/>
Once Strapi has restarted, "Restaurant" is listed under Content Manager > Collection types in the navigation. Wow, you have just created your very first content-type! It was so cool, let's create another one right now, just for pleasure.
It would help getting a bit more organized if our restaurants directory had some categories. Let's create a "Category" collection type:
- Go to in the main navigation.
- Click on the plus icon next to Collection types.
- Type
Categoryfor the Display name, and click Continue. - Click on the Add new field button, and select the Text field.
- Type
Namein the Name field. - Switch to the Advanced Settings tab, and check the Required field and the Unique field settings.
- Click on Add another field.
- Choose the Relation field.
- In the center, select the icon that represents "many-to-many"
.
- On the right, click on Category dropdown and choose Restaurant in the list. The text should read
Categories has and belongs to many Restaurants.
<ThemedImage
alt="Admin Panel screenshot: relations"
sources={{
light: '/img/assets/quick-start-guide/qsg-handson-part2-02-collection_ct-v6.png',
dark: '/img/assets/quick-start-guide/qsg-handson-part2-02-collection_ct-v6_DARK.png',
}}
/>
- Finally, click Finish, then the Save button, and wait for Strapi to restart.
:::callout Congratulations!
You have just created a basic content structure for your Strapi project! You can keep on playing with the Content-Type Builder, or proceed to parts C and D below to discover Strapi Cloud and add actual content to your project.
:::
Part C: Deploy to Strapi Cloud#
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.
We recommend deploying from the Strapi Cloud dashboard. This guide walks you through pushing your local project to GitHub, then creating and deploying a Strapi Cloud project from the dashboard.
If your local Strapi server is still running, press Ctrl-C to stop it.
Deploying from the dashboard requires your project to be hosted on a GitHub repository. Push your local Strapi project to GitHub like you would do it for any other code repository (see additional instructions below if needed).
Now that your project is hosted on GitHub, let's create and deploy your Strapi Cloud project from the dashboard:
- Navigate to the login page and log in with GitHub, Google, GitLab, or a one-time password.
- From the Projects page, click Create project.
- Choose a plan and connect the GitHub account you just used. Select the newly created repository from the list.
- Fill in your project settings (display name, branch, region) and complete the subscription step.
- Confirm the project creation. Strapi Cloud redirects you to your project dashboard, where you can follow the first deployment.
For detailed instructions and screenshots, see the Project deployment with the Cloud dashboard guide.
Once the deployment is complete, click the Visit app button in the top right corner to access your deployed Strapi project.
<ThemedImage
alt="Visit Strapi Cloud App GIF"
sources={{
light: '/img/assets/quick-start-guide/qsg-visit-cloud-app-2.gif',
dark: '/img/assets/quick-start-guide/qsg-visit-cloud-app-2_DARK.gif',
}}
/>
:::callout Congratulations!
Now your project is hosted on Strapi Cloud and accessible online. You can learn more about Strapi Cloud by reading its dedicated documentation or proceed to part D to log in into your online Strapi project and add your first data from there.
:::
Part D: Add content to your Strapi Cloud project with the Content Manager#
Now that we have created a basic content 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.
Now that your Strapi Cloud project is created, let's log in into the project:
- From your , click the
my-strapi-projectproject. - Click the Visit app button.
- In the new page that opens, complete the form to create the first administrator user of this Strapi Cloud project.
Logged in into our first Strapi Cloud project, we will now add data from there.
<ThemedImage
alt=""
sources={{
light: '/img/assets/quick-start-guide/qsg-first-login-cloud.gif',
dark: '/img/assets/quick-start-guide/qsg-first-login-cloud_DARK.gif'
}}
/>
Additional information and tips about users and Strapi Cloud projects:
:::note Note: Local users and Strapi Cloud users are different
The databases for your Strapi Cloud project and your local project are different. This means that data is not automatically transferred from your local project to Strapi Cloud. This includes users that you previously created locally. That's why you are invited to create a new administrator account when logging in to your Strapi Cloud project for the first time.
:::
:::tip Tip: Directly accessing the admin panel of your Strapi Cloud project
Any project hosted on Strapi Cloud is accessible from its own URL, something like https://my-strapi-project-name.strapiapp.com. To access the admin panel of your online project, simply add /admin to the URL, for instance as in https://my-strapi-project-name.strapiapp.com/admin. URLs can be found in your Strapi Cloud dashboard and you can also directly access your Strapi Cloud projects from there by clicking on the name of your project then on the Visit app button.
:::
- Go to Content Manager > Collection types - Restaurant in the navigation.
- Click on Create new entry.
- Type the name of your favorite local restaurant in the Name field. Let's say it's
Biscotte Restaurant. - In the Description field, write a few words about it. If you're lacking some inspiration, you can use
Welcome to Biscotte restaurant! Restaurant Biscotte offers a cuisine based on fresh, quality products, often local, organic when possible, and always produced by passionate producers. - Click Save.
<ThemedImage
alt="Screenshot: Biscotte Restaurant in Content Manager"
sources={{
light: '/img/assets/quick-start-guide/qsg-handson-part2-03-restaurant-v5.png',
dark: '/img/assets/quick-start-guide/qsg-handson-part2-03-restaurant-v5_DARK.png',
}}
/>
The restaurant is now listed in the Collection types - Restaurant view of the Content Manager.
Let's go to Content Manager > Collection types - Category and create 2 categories:
- Click on Create new entry.
- Type
French Foodin the Name field. - Click Save.
- Go back to Collection types - Category, then click again on Create new entry.
- Type
Brunchin the Name field, then click Save.
<ThemedImage
alt="GIF: Add Categories"
sources={{
light: '/img/assets/quick-start-guide/qsg-handson-categories-v5.gif',
dark: '/img/assets/quick-start-guide/qsg-handson-categories-v5_DARK.gif',
}}/>
The "French Food" and "Brunch" categories are now listed as drafts in the Collection types - Category view of the Content Manager.
Now, we will add a category to a restaurant:
- Go to Content Manager > Collection types - Restaurant in the navigation, and click on "Biscotte Restaurant".
- In the Categories drop-down list at the bottom of the page, select "French Food". Scroll back to the top of the page and click Save.
We have just added a restaurant and 2 categories. We now have enough content to consume (pun intended). But first, we need to make sure that the content is publicly accessible through the API:
- Click on Settings at the bottom of the main navigation.
- Under Users & Permissions Plugin, choose Roles.
- Click the Public role.
- Scroll down under Permissions.
- In the Permissions tab, find Restaurant and click on it.
- Click the checkboxes next to find and findOne.
- Repeat with Category: click the checkboxes next to find and findOne.
- Finally, click Save at the top of the page.
<ThemedImage
alt="Screenshot: Public Role in Users & Permissions plugin"
sources={{
light: '/img/assets/quick-start-guide/qsg-handson-part2-04-roles-v5.png',
dark: '/img/assets/quick-start-guide/qsg-handson-part2-04-roles-v5_DARK.png'
}}/>
By default, any content you create is saved as a draft. Let's publish our categories and restaurant.
First, navigate to Content Manager > Collection types - Category. From there:
- Click the "Brunch" entry.
- On the next screen, click Publish.
Then, go back to the Categories list and repeat for the "French Food" category.
Finally, to publish your favorite restaurant, go to Content Manager > Collection types - Restaurant, click the "Biscotte Restaurant" entry, and Publish it.
<ThemedImage
alt="GIF: Publish content"
sources={{
light: '/img/assets/quick-start-guide/qsg-handson-publish-v5.gif',
dark: '/img/assets/quick-start-guide/qsg-handson-publish-v5_DARK.gif'
}}
/>
OK dear gourmet, we have just finished creating our content and making it accessible through the API. You can give yourself a pat on the back — but you have yet to see the final result of your hard work.
There you are: the list of restaurants should be accessible by visting the /api/restaurants path of your Strapi Cloud project URL (e.g., https://beautiful-first-strapi-project.strapiapp.com/api/restaurants).
Try it now! The result should be similar to the example response below 👇.
Click me to view an example of API response:
{
"data": [
{
"id": 3,
"documentId": "wf7m1n3g8g22yr5k50hsryhk",
"Name": "Biscotte Restaurant",
"Description": [
{
"type": "paragraph",
"children": [
{
"type": "text",
"text": "Welcome to Biscotte restaurant! Restaurant Biscotte offers a cuisine based on fresh, quality products, often local, organic when possible, and always produced by passionate producers."
}
]
}
],
"createdAt": "2024-09-10T12:49:32.350Z",
"updatedAt": "2024-09-10T13:14:18.275Z",
"publishedAt": "2024-09-10T13:14:18.280Z",
"locale": null
}
],
"meta": {
"pagination": {
"page": 1,
"pageSize": 25,
"pageCount": 1,
"total": 1
}
}
}
:::callout Congratulations!
Now your content is created, published, and you have permissions to request it through the API.
Keep on creating amazing content!
:::
:::tip Tip: Transfer data between your local and Strapi Cloud projects
The databases for your Strapi Cloud project and your local project are different. This means that data is not automatically synchronized between your Strapi Cloud and local projects. You can use the data management system to transfer data between projects.
:::