Strapi : debug ⛔️ Server wasn't able to start properly

Viewed 20996

Please fix my problem.

It works when I try more than 50 times. Now it does not work I try 100+ times.

I start this -> strapi new server

� Starting to create your Strapi application.

? Choose your installation type Custom (manual settings)
? Choose your main database: MongoDB
? Database name: server
? Host: @cluster0-8tfpd.mongodb.net
? +srv connection: true
? Port (It will be ignored if you enable +srv): 27017
? Username: deep
? Password: *******
? Authentication database (Maybe "admin" or blank):
? Enable SSL connection: true

⏳ Testing database connection...
It might take a minute, please have a coffee ☕️

The app has been connected to the database successfully!

�  Application generation:
√ Copy dashboard
√ Install plugin settings-manager.
√ Install plugin content-type-builder.
√ Install plugin content-manager.
√ Install plugin users-permissions.
√ Install plugin email.
√ Install plugin upload.
√ Link strapi dependency to the project.

� Your new application server is ready at E:\Dev. Project\Flutter\flutter_ecommerce\server.

⚡️ Change directory:
$ cd server

⚡️ Start application:
$ strapi start  

But problem is -> strapi start

[2019-06-15T09:34:30.604Z] debug ⛔️ Server wasn't able to start properly. [2019-06-15T09:34:30.609Z] error Make sure your MongoDB database is running...

6 Answers

See the picture

You should add an entry uri into your ./config/environment/.../database.json

uri should be mongodb://<host>:<port>/<database name>

If you face this error while working with docker, Adding --network=host solves this problem. Keep in mind, use this solution only locally.

As described by docker itself,

--network="host" gives the container full access to local system services such as D-bus and is therefore considered insecure.

  1. Check is MongoDB instance is running
  2. Check in the settings that host is correct: ./config/environment/.../database.json. Usually in development is localhost

If this error happens again, then go with strapi console rather than strapi start

I faced the same problem but when I was installing it i used sudo and when i tried to start the strapi server without sudo it didn't work but when I used sudo npm run develop and it worked successfully

Related