Closed PaRoxUs closed 4 years ago
I was able to run it locally by cloning the repo and doing below. I used postgres in the local setup.
Set up DB
run postgres locally on port 5432
create a new db named say strapidb in local postgres server
cd in the cloned repo
restore DB from the dump provided in the repo by executing following command in your terminal pg_restore -h localhost -p 5432 -d strapidb -U
Set up backend
cd cloned repo folder
cd back
yarn install
copy .env.example to .env and set the environment variables
DATABASE_URL=postgres://user:pwd@localhost:5432/strapidb
ADMIN_JWT_SECRET=
edit back/config/database.js to comment out lines 7 to 24 which contain code to use sqllite in development mode. We are going to use postgres in development mode also so change line 27 to include development mode as well
if (environment === 'production' || environment === 'development') {
yarn develop
open localhost:1337/admin in your browser and sign up for an admin account
You should see Strapi admin console.
Set Up Front End
cd cloned repo folder
cd front
yarn install
copy .env.local.example to .env.local and set any value for PREVIEW_SECRET
yarn dev or (yarn build and then yarn start)
open localhost:3000 in your browser and you should see the app running.
@KapilGahlot
❯ yarn develop yarn run v1.22.4 $ strapi develop [2020-08-03T08:14:00.685Z] debug ⛔️ Server wasn't able to start properly. [2020-08-03T08:14:00.686Z] error Error: The server does not support SSL connections
The server does not support SSL connections
I did not face this issue but this could be related to line # 43 in back/config/database.js where ssl option is being set for the postgres database connection. Try below and then start the server by yarn develop.
Comment out line # 43 in back/config/database.js - // ssl: { rejectUnauthorized: false }
@KapilGahlot
weird behaviour, after commenting it out I get another error:
❯ yarn develop yarn run v1.22.4 $ strapi develop [2020-08-03T09:32:53.727Z] debug ⛔️ Server wasn't able to start properly. [2020-08-03T09:32:53.727Z] error error: role "user" does not exist
@KapilGahlot
weird behaviour, after commenting it out I get another error:
❯ yarn develop yarn run v1.22.4 $ strapi develop [2020-08-03T09:32:53.727Z] debug ⛔️ Server wasn't able to start properly. [2020-08-03T09:32:53.727Z] error error: role "user" does not exist
Assuming you were able to restore DB locally, the error you are getting is likely because of DB URL you are trying to connect to. Assuming you have not created a user for DB, please change DATABASE_URL in .env to DATABASE_URL=postgres://localhost:5432/strapidb and then restart server by yarn develop
In my earlier post I put user:pwd@ just as an example where actual user and password needed to be put in. If there is no user, you can ignore that and use what I mentioned here above.
Thanks, I should've picked up on that 👍
Hello there!
You're right, the experience to run this starter in development is not good enough.
We should use Postgres both in development and production. Though it requires more config than SQLite, it's worth it:
@KapilGahlot 's approach for this is great. I'll update the docs to recommend it.
Thanks for the early feedback!
Although Heroku and Vercel provide smooth solutions, I'm experiencing the setup a bit overkill to test a starter app. The direction provided in this git might be more sustainable in the long run, but having a guide on how to run the app locally would be very much appreciated too!