When hosting your server on Heroku you need make sure to:
Next login or sign-up for Heroku and configure your app:
Create a new app from the top menu and set your app name and preferred region where the server is hosted:
Deploy your by connecting via Github or using the Heroku CLI. This will import your code to heroku and will automatically rebuild your app when changes are pushed to your repo.
As a final step you need to set your environment variables.
Navigate to "Settings" and reveal the keys. Here you can paste all the variables from your
.env file. Make sure that these variables are production-ready (no references to localhost, and different database that used in local development)
Make sure to update
SERVER_URL in the config vars to the deployed url on Heroku. This looks something like
moralis-demo.herokuapp.com/server. Also make sure to set this same serverUrl in your frontend.
Google App Engine
- Complete previous steps and have your environment variables ready.
- Complete GCP integration prerequisites
If your Google Cloud free trial has ended, the following process could resort to expenses.
Replace the environment variables values in
app.yaml with your own:
Open the terminal, make sure you're in the root folder and run:
gcloud app deploy
Choose your region:
Y to continue:
After a couple minutes the application is deployed:
Now run the following command to see it on the browser:
gcloud app browse
/server to the URL and you'll be accessing your Moralis Parse Server hosted on Google App Engine:
AWS Elastic Beanstalk
Be aware that this process could resort to expenses as Elastic Beanstalk is not part of AWS Free Tier.
And follow the instructions below:
Scroll down leaving all the other settings as default and choose Upload your code:
Public S3 URL should be automatically selected and filled. Make sure it is so and choose Review and launch:
Scroll down leaving all the settings as default and choose Create app:
After a couple minutes the application is created but the environment is not ready because you need to set your environment variables:
In the left navigation pane, go to Configuration and at the row where we find Environment properties, choose Edit:
Paste the environment variables retrieved on the previous steps to the corresponding fields (marked in green) and choose Apply:
This video also shows you how to get the environment variables.
Elastic Beanstalk will update your environment and after a couple of minutes it will be ready:
In the left navigation pane, choose Go to environment to test it:
/server to the URL and you'll be accessing your Moralis Parse Server hosted on AWS Elastic Beanstalk:
Setup ECS environment
Create ECR repository
Open the Amazon ECR console and choose Get Started Create repo. Name it
Leave everything else as it is and choose Create repository.
Copy and save the Repository name and the URI as you'll need them in the next step:
Create a Task Definition //TODO Maybe through JSON?
Open the Amazon ECS console. In the navigation pane, choose Task Definitions and Create new task definition:
On the Select compatibilities page, select EC2 and choose Next step:
Name your task
On the Container definitions section, click on Add container:
Fill the Container name and the Image with the Repository name and the URI that you copied from the created ECR repository:
Set Memory Limits to
500 and Port mappings to
Leave all the other settings as default and choose Add.
With the container added, scroll down and choose Create. You should see the task definition created:
Create a Cluster
Open the Amazon ECS console. In the navigation pane, choose Clusters and Create Cluster:
For Select cluster compatibility, choose EC2 Linux + Networking and then choose Next Step:
On the Configure cluster page, enter a Cluster name, like
Scroll down leaving all the other settings as default and choose Create. After some seconds you should see the cluster created:
Create a service
Open the Amazon ECS console. In the navigation pane, choose Clusters and select your created cluster:
On the Services tab, choose Create:
On the Configure service page, choose EC2 as Launch type:
Select the Task definition and the Cluster that you just created:
Set the Service name as
Set the following fields:
- Number of tasks:
- Minimum healthy percent:
- Maximum percent:
This value configuration will allow the deployment of updated containers.
Scroll down leaving the other settings as default and choose Next step a couple times and then Create service. You should see the service created:
This will also create a MongoDB and Redis instance for you automatically, all managed by Railway. If you are using your own MongoDB/Redis instances, you can follow Manual Deployment, or use this template and just delete the MongoDB and Redis services later.
- After your server has deployed, assign it a domain (see Step 4 of Manual Deployment).
- Copy your MongoDB and Parse connection URL (from the "Connect" tab from Mongo).
- Click on the "Variables" tab in your Parse Server and update:
SERVER_URLwith the domain from Step 1 e.g.
DATABASE_URIwith your MongoDB connection URL e.g.
REDIS_CONNECTION_STRINGwith your Redis connection URL e.g.
Your server will re-deploy after these changes.
- Go to Railway, click "Start a New Project" and choose "Deploy from GitHub repo". Connect your GitHub account.
- Give permission for Railway to access your self-hosted server repository and click "Deploy Now":
- In your project's deployment page, click on the "Variables" tab and then "Raw Editor". Paste in your environment variables and click "Update Variables":
- Click on the "Settings" tab and under "Domains", click "Generate Domain". You can choose a different Railway domain or use your own custom domain:
- Copy this domain and update your
SERVER_URLenvironment variable. Your project will re-deploy:
6: After your re-deploy is successful, open your Railway project URL in your browser to test: