Strapi Setup Guide: Local Development & Cloud Deployment

7月26日 Published inWebsite Builders

Flexible Deployment – Choose between self-hosting or managed cloud services. Use Strapi Cloud for a fast start, or deploy to major providers like AWS, Azure, or Google Cloud. Customizable Admin Panel – An intuitive, elegant interface that can be extended to suit your specific project needs. Multiple Database Support – Compatible with PostgreSQL, MySQL, MariaDB, and SQLite. Select the database that best fits your technical requirements. Stable Performance – Built on Node.js and TypeScript to ensure an efficient and reliable runtime environment. Secure by Default – Includes built-in protections against CORS, CSP, and XSS attacks, alongside reusable permission policies. Efficient CLI – Quickly initialize projects and scaffold APIs directly from the command line.


Strapi Local Setup

Before installing Strapi, ensure your development environment meets the following requirements:

  • OS: Ubuntu LTS / Debian 9.x, CentOS/RHEL 8, macOS Mojave, Windows 10, or Docker. Other systems may function but are not officially tested.
  • Node.js: Only Maintenance and LTS versions are supported. Each Strapi version recommends a specific release (e.g., Strapi 4.14.5 and above requires Node.js 20.x).
  • Package Manager: npm (v6 or later), yarn, or pnpm.
  • Other Tools: Python is required if you are using SQLite. For Strapi Cloud deployment, you will need Git installed and a GitHub account.

Quick Start: Create a Strapi Project

Open your terminal and run one of the following commands:

Using yarn (recommended):

yarn create strapi-app my-project --quickstart

Using npm/npx:

npx create-strapi-app my-project --quickstart

These commands generate a project pre-configured with essential features—such as authentication, permissions, and content management—and use SQLite by default, making them ideal for prototyping.

To connect directly to Strapi Cloud, run:

npx create-strapi@latest my-strapi-project

Follow the terminal prompts to log in or sign up for Strapi Cloud. You will automatically receive a 30-day trial of the Growth plan.

Create an Admin Account and Launch the Project

Once the installation is complete, navigate to the project folder and start the development server:

cd my-strapi-project && yarn develop

Your browser will automatically open the admin panel. Complete the registration form to create an admin account, then log in to begin using Strapi.

Build Your Content Structure

Strapi’s Content-Type Builder allows you to define your content models. Below is an example of how to create "Restaurant" and "Category" collection types.

1. Create the “Restaurant” Collection Type
  • Click “Create your first Content type,” then select “Create new collection type.”
  • Enter the display name “Restaurant” and click “Continue.”
  • Add the following fields:
    • Text field: Name it “Name.” In the advanced settings tab, check “Required” and “Unique.”
    • Rich text field: Name it “Description.”
  • Click “Save” and wait for the Strapi server to restart.
2. Create the “Category” Collection Type
  • Create another new collection type with the display name “Category.”
  • Add a Text field named “Name,” ensuring “Required” and “Unique” are checked.
  • Add a Relation field: Select the “many-to-many” relationship (Categories has and belongs to many Restaurants).
  • Save the changes and wait for the server to restart.

After the restart, both collection types will appear in the Content Manager sidebar.


Deploy to Strapi Cloud and Add Content

Deploy Your Project

Once your local project is configured, you can deploy it to Strapi Cloud:

  • If your local server is currently running, press Ctrl+C to stop it.
  • Run the deployment command within your project folder:
# Using yarn
yarn strapi deploy

# Using npm
npm run strapi deploy
  • Follow the prompts to set your project name, Node.js version (20.x is recommended), and preferred deployment region.

Once the process finishes, the terminal will provide a link to the Strapi Cloud console. Use this link to access your live production project.

Add and Publish Content

  1. Log in to the Cloud Admin Panel – From the Strapi Cloud console, click “Visit app.” Create a new cloud admin account and log in.
  2. Create a Restaurant Entry – Navigate to Content Manager > Collection types > Restaurant and click “Create new entry.” Enter a name (e.g., “Biscotte Restaurant”) and a description, then click “Save.”
  3. Create Category Entries – Navigate to the Category collection type. Create two categories: “French Food” and “Brunch.” Return to your Restaurant entry and select “French Food” from the category dropdown menu. Save your changes.
  4. Set Permissions – Go to Settings > Users & Permissions Plugin > Roles and select the “Public” role. Under the permissions section, check “find” and “findOne” for both Restaurant and Category. Click “Save.”
  5. Publish Content – Open each restaurant and category entry, click “Publish,” and confirm.

Once published, you can access your restaurant data via the API at: https://[your-project-name].strapiapp.com/api/restaurants


More Useful Features

  • Internationalization – Utilize the i18n plugin to manage and deliver content in multiple languages.
  • Media Library – Upload and organize images, videos, and other assets for easy reuse across your entries.
  • API Support – Fetch your content effortlessly via either REST or GraphQL.
  • Advanced Features – Strapi Cloud and Enterprise editions provide additional tools such as Single Sign-On (SSO), audit logs, and custom review workflows.