In this tutorial, we will show you how to install Parse Server on Ubuntu 20.04 LTS. For those of you who didn’t know, Parse is an open-source Backend as a Service (BaaS) platform commonly used over the last few years. It is written in Node.js and can be used for any application running Node.js. Parse Server comes with a simple and easy-to-use web interface that can be used for data manipulation, to view analytics, and to schedule and send push notifications.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo
‘ to the commands to get root privileges. I will show you the step-by-step installation of the Parse Server on Ubuntu 20.04 (Focal Fossa). You can follow the same instructions for Ubuntu 18.04, 16.04, and any other Debian-based distribution like Linux Mint.
Prerequisites
- A server running one of the following operating systems: Ubuntu 20.04, 18.04, 16.04, and any other Debian-based distribution like Linux Mint.
- It’s recommended that you use a fresh OS install to prevent any potential issues.
- A
non-root sudo user
or access to theroot user
. We recommend acting as anon-root sudo user
, however, as you can harm your system if you’re not careful when acting as the root.
Install Parse Server on Ubuntu 20.04 LTS Focal Fossa
Step 1. First, make sure that all your system packages are up-to-date by running the following apt
commands in the terminal.
sudo apt update sudo apt upgrade
Step 2. Installing Node.js.
Now add Node.js repository to your system:
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - sudo apt install nodejs
Next, install a yarn package manager on your system. This will be used to install node modules:
npm install -g yarn
Step 3. Installing MongoDB.
By default, MongoDB is available in the Ubuntu 20.04 default repository. You can install it by running the following command:
sudo apt install mongodb-server
Step 4. Installing Parse Server on Ubuntu 20.04.
You can install the parse-server module using the Yarn package manager:
yarn global add parse-server
Then, create a Parse server configuration file and define the attributes of the parse server:
nano config.json
Add the following line:
{ "appName": "My Parse Server App", "databaseURI": "mongodb://localhost:27017/parsedb", "appId": "KSDJFKASJFI3S8DSJFDH", "masterKey": "LASDK823JKHR87SDFJSDHF8DFHASFDF", "serverURL": "https://localhost:1337/parse", "publicServerURL": "https://0.0.0.0:1337/parse", "port": 1337 }
The configuration details are as follows:
appName
: Set any name for your Parse serverdatabaseURI
: Connection string to the MongoDB databaseappID
: Set a random string as appID, which will be used to connect the server.masterKey
: Set a random string for the master key.serverURL
: Set a URL for your parse serverpublicServerURL
: Set a public URL for your parse serverport
: Indicate the server port
Save and close the file then start the parse server using the following command:
nohup parse-server config.json &
Step 5. Configure Parse Server Dashboard.
Parse server comes with a Dashboard for managing your Parse server applications. It is accessible through a web browser. Run the below command to install parse-dashboard:
yarn global add parse-dashboard
After that, create a configuration file for the parse dashboard:
nano parse-darshboard-config.json
Add the following file:
{ "apps": [ { "serverURL": "http://67.205.146.114:1337/parse", "appId": "KSDJFKASJFI3S8DSJFDH", "masterKey": "LASDK823JKHR87SDFJSDHF8DFHASFDF", "allowInsecureHTTP": "true", "appName": "MyApps" } ], "users": [ { "user":"admin", "pass":"your-password" } ], "iconsFolder": "icons" }
Save and close the file, then start the Parse dashboard with the following command:
nohup parse-dashboard --dev --config parse-darshboard-config.json &
Step 6. Configure Firewall.
We are using port 1337 for the parse server and 4040 for the dashboard. Run the following commands to allow access for public users for the Parse server. To open port type:
sudo firewall-cmd --permanent --zone=public --add-port=1337/tcp sudo firewall-cmd --permanent --zone=public --add-port=4040/tcp sudo firewall-cmd --reload
Step 7. Accessing Parse Server Dashboard.
Once successfully installed, you can also access the parse server dashboard by visiting the URL http://your-server-ip-address:4040
in your web browser. You should see the following screen:
Congratulations! You have successfully installed Parse. Thanks for using this tutorial for installing the Parse Server on Ubuntu 20.04 LTS Focal Fossa system. For additional help or useful information, we recommend you check the official Parse Server website.