DEV Community

Tobe Obiakor
Tobe Obiakor

Posted on

Deploying Strapi on Render free plan

This post assumes that you have already installed the Strapi backend on your local machine. If you have not, you can do that by following the instructions on the link below.
Install strapi and create new project
After installation, create a new user and create your collections.
In your command line navigate to the root folder and initialize git and push to remote origin. If you do not know how to go about it, you can do so following the instruction below.
Adding locally hosted code to GitHub
login to render and click on the new button

installing a new app on render
Select Web Service.
Connect to your GitHub or GitLab Account. and click on the connect button beside the repo you selected

connect to github

Enter a unique name for your web service

web service name

Change the start command from yarn start to yarn develop. this is to enable you create collection on the production environment

start command
Leave every other thing as is and click on create Web Service.

create web service
The deployment starts

start deployment
Select Environment from the left navigation pane and click on the Add Secret File button

Add Secret File

enter the file name as .env, click on the eye icon

create secret file

copy the content of the .env file in your root folder on local and paste it in the textarea.
change the value of DATABASE_FILENAME to /data/strapi.db from .tmp/data.db
click on done

.env content

Click on the save changes button.
Click on Events on the left navigation pane to monitor your deployment.

deploy text

Select the deployment by clicking on the deploy text.
the log should display like this when the deployment is done.

deploy complete
visit your url/admin to access the strapi backend deployed

Top comments (0)