Files
medusa-store/docs/content/quickstart/quick-start-docker.mdx
Shahed Nasser 589cb18f98 docs: improved SEO of documentation (#3117)
* docs: added description to documentation pages

* docs: added more descriptions

* docs: finished improving meta description

* docs: added searchbox structured data

* docs: added breadcrumbs structured data

* docs: added how to structured data

* docs: improved 404 page

* docs: added how-to frontmatter option
2023-01-26 15:58:33 +02:00

118 lines
3.5 KiB
Plaintext

---
description: 'Learn how to create a composable commerce platform using Medusa. This quickstart guide will help you set up your Medusa server using Docker. '
addHowToData: true
---
import Feedback from '@site/src/components/Feedback';
# Quickstart using Docker: Medusa Server
In this document, you will learn how to make a container of Medusa's app on Docker. Docker is an open source platform for building, deploying, and managing containerized applications.
## Prerequisites
### Node.js
Medusa supports Node versions 14 and 16. You can check which version of Node you have by running the following command:
```bash noReport
node -v
```
You can install Node from the [official website](https://nodejs.org/en/).
### Docker Desktop
It is assumed that you have Docker installed on your system. You can install it from [Docker's website](https://docs.docker.com/get-docker/).
---
## Create Medusa Server with Docker
### 1. Clone Medusa's starter project from GitHub
```bash noReport
git clone https://github.com/medusajs/medusa-starter-default.git my-medusa-starter
```
### 2. Change to the newly created project directory
```bash noReport
cd my-medusa-starter
```
### 3. Rename the environment variables(.env) file
```bash noReport
mv .env.template .env
```
### 4. Start your server
Make sure the Docker Desktop app is running. Then, run the following command:
```bash noReport
docker-compose up --build
```
:::note
If you get the error `ERROR: for postgres Cannot start service postgres: Ports are not available`, change the ports used for PostgreSQL in `docker-compose.yml` to something like this:
```yml noReport
postgres:
ports:
- "5433:5433"
```
:::
Running the above command does the following:
1. Build images for your Medusa project, a PostgreSQL database, and a Redis server
2. Run migrations for your newly created database
<Feedback
event="survey_server_docker_quickstart"
question="Did you set up the server successfully?"
positiveQuestion="Is there anything that should improved?"
negativeQuestion="Please describe the issue you faced."
/>
---
## Test Your Server
Once done, your server will be accessible at `http://localhost:9000`.
You can test out your server using tools like Postman or by sending a cURL request:
```bash noReport
curl -X GET localhost:9000/store/products
```
---
## Additional steps
### File Service Plugin
To upload product images to your Medusa server, you must install and configure one of the following file service plugins:
- [MinIO](../add-plugins/minio.md) (Recommended for local development)
- [S3](../add-plugins/s3.md)
- [DigitalOcean Spaces](../add-plugins/spaces.md)
### Server Configurations
It's important to configure your Medusa server properly and learn how environment variables are loaded.
You can learn more about configuring your server and loading environment variables in the [Configure your Server documentation](../usage/configurations.md).
---
## See Also
- Install the [Next.js](../starters/nextjs-medusa-starter.mdx) or [Gatsby](../starters/gatsby-medusa-starter.mdx) storefronts to set up your ecommerce storefront quickly.
- Install the [Medusa Admin](../admin/quickstart.mdx) to supercharge your ecommerce experience with easy access to configurations and features.
- Check out the [API reference](https://docs.medusajs.com/api/store) to learn more about available endpoints available on your Medusa server.
- Install [plugins](https://github.com/medusajs/medusa/tree/master/packages) for features like Payment, CMS, and Notifications, among other features.