Atlantic.Net Blog

How to Install and Configure Parse Server on Ubuntu 20.04

Hitesh Jethva
by Atlantic.Net (76posts) under VPS Hosting
0 Comments

Parse Server is a free and open-source Backend-as-a-Service platform developed by Facebook. 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.

In this tutorial, we will show you how to install Parse Server on Ubuntu 20.04.

Prerequisites

  • A fresh Ubuntu 20.04 VPS on the Atlantic.net Cloud Platform
  • A root password configured on your server

Step 1 – Create Atlantic.Net Cloud Server

First, log in to your Atlantic.Net Cloud Server.  Create a new server, choosing Ubuntu 20.04 as the operating system with at least 1GB RAM. Connect to your Cloud Server via SSH and log in using the credentials highlighted at the top of the page.

Once you are logged in to your Ubuntu 20.04 server, run the following command to update your base system with the latest available packages.

apt-get update -y

Step 2 – Install MongoDB

By default, MongoDB is available in the Ubuntu 20.04 default repository. You can install it by running the following command:

apt-get install mongodb-server -y

Once the MongoDB is installed, you can verify the status of MongoDB with the following command:

systemctl status mongodb

You should see the following output:

● mongodb.service - An object/document-oriented database
     Loaded: loaded (/lib/systemd/system/mongodb.service; enabled; vendor preset: enabled)
     Active: active (running) since Thu 2020-08-06 07:32:44 UTC; 30s ago
       Docs: man:mongod(1)
   Main PID: 3222 (mongod)
      Tasks: 23 (limit: 4691)
     Memory: 42.0M
     CGroup: /system.slice/mongodb.service
             └─3222 /usr/bin/mongod --unixSocketPrefix=/run/mongodb --config /etc/mongodb.conf
Aug 06 07:32:44 ubuntu2004 systemd[1]: Started An object/document-oriented database.

Step 3 – Install Node.js

By default, Node.js is not available in the Ubuntu 20.04 default repository, so you will need to add Node.js repository to your system. You can add it with the following command:

curl -sL https://deb.nodesource.com/setup_12.x | bash -

Next, install the Node.js with the following command:

apt-get install nodejs -y

Once installed, run the following command to install yarn package manager:

npm install -g yarn

You can also verify the Node.js version with the following command:

node --version

You should get the following output:

v12.18.3

Step 4 – Install Parse Server

You can install the parse-server module using the Yarn package manager as shown below:

yarn global add parse-server

Once installed, you will need to create a parse server configuration file and define the attributes of the parse server. You can create it with the following command:

nano config.json

Add the following lines:

{
  "appName": "My Parse Server",
  "databaseURI": "mongodb://localhost:27017/parsedb",
  "appId": "KSDJFKASJFI3S8DSJFDH",
  "masterKey": "LASDK823JKHR87SDFJSDHF8DFHASFDF",
  "serverURL": "https://localhost:1337/parse",
  "publicServerURL": "https://0.0.0.0:1337/parse",
  "port": 1337
}

Save and close the file then start the parse server using the following command:

nohup parse-server config.json &

At this point, the parse server is started and listening on port 1337. You can verify it with the following command:

ss -ant | grep 1337

You should get the following output:

LISTEN     0       511            0.0.0.0:1337            0.0.0.0:*            
TIME-WAIT  0       0            127.0.0.1:1337          127.0.0.1:40568     

Step 5 – Configure Parse Server Dashboard

Parse server comes with a powerful dashboard that allows you to access the Parse server through a web browser. You can install the parse dashboard with the following command:

yarn global add parse-dashboard

After installing the Parse dashboard, create a configuration file for the Parse dashboard with the following command:

nano parse-darshboard-config.json

Add the following lines:

{
  "apps": [
    {
      "serverURL": "http://your-server-ip:1337/parse",
      "appId": "KSDJFKASJFI3S8DSJFDH",
      "masterKey": "LASDK823JKHR87SDFJSDHF8DFHASFDF",
      "allowInsecureHTTP": "true",
      "appName": "MyApp1"
    }
  ],
 "users": [
    {
      "user":"admin",
      "pass":"yourpassword"
    }
  ],
  "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 &

At this point, the Parse dashboard is started and listening on port 4040. You can verify it with the following command:

ss -ant | grep 4040

You should get the following output:

LISTEN  0       511            0.0.0.0:4040             0.0.0.0:*     

Step 6 – Verify Parse Server

At this point, the Parse server is installed and configured. Now, perform some tests to make sure it’s running.

First, add some values to the Parse server with the following command:

curl -X POST -H "X-Parse-Application-Id: KSDJFKASJFI3S8DSJFDH" -H "Content-Type: application/json" -d '{"score":1337,"InventoryName":"Desktops","cheatMode":false}' http://localhost:1337/parse/classes/Inventory

You should get the following output:

{"objectId":"BCq9j8fPfM","createdAt":"2020-08-06T07:48:14.530Z"}

Now, fetch the value from the Parse server using the following command:

curl -X GET -H "X-Parse-Application-Id: KSDJFKASJFI3S8DSJFDH" http://localhost:1337/parse/classes/Inventory/BCq9j8fPfM

You should get the following output:

{"objectId":"BCq9j8fPfM","score":1337,"InventoryName":"Desktops","cheatMode":false,"createdAt":"2020-08-06T07:48:14.530Z","updatedAt":"2020-08-06T07:48:14.530Z"}

Step 7 – Access Parse Server Dashboard

You can also access the parse server dashboard by visiting the URL http://your-server-ip:4040 in your web browser. You should see the following screen:

Provide your admin username and password which you have defined in the Parse dashboard configuration file and click on the Log in button. You should see the Parse server dashboard in the following screen:

Conclusion

In this guide, you learned how to install Parse Server and Parse Dashboard in Ubuntu 20.04 server. You can now build your mobile application’s backend with Parse Server on a VPS Hosting account from Atlantic.Net!

Get A Free To Use Cloud VPS

Free Tier Includes:
G2.1GB Cloud VPS Free to Use for One Year
50 GB of Block Storage Free to Use for One Year
50 GB of Snapshots Free to Use for One Year


Looking for a Hosting Solution?

We Provide Cloud, Dedicated, & Colocation.

  • Seven Global Data Center Locations.
  • Flexible Private, Public, & Hybrid Hosting.
  • 24x7x365 Security, Support, & Monitoring.
Contact Us Now! Med Tech Award FTC
SOC Audit HIPAA Audit HITECH Audit

Recent Posts

Get started with 12 months of free cloud VPS hosting

Free Tier includes:
G2.1GB Cloud VPS Server Free to Use for One Year
50 GB of Block Storage Free to Use for One Year
50 GB of Snapshots Free to Use for One Year


New York, NY

100 Delawanna Ave, Suite 1

Clifton, NJ 07014

United States

San Francisco, CA

2820 Northwestern Pkwy,

Santa Clara, CA 95051

United States

Dallas, TX

2323 Bryan Street,

Dallas, Texas 75201

United States

Ashburn, VA

1807 Michael Faraday Ct,

Reston, VA 20190

United States

Orlando, FL

440 W Kennedy Blvd, Suite 3

Orlando, FL 32810

United States

Toronto, Canada

20 Pullman Ct, Scarborough,

Ontario M1X 1E4

Canada

London, UK

14 Liverpool Road, Slough,

Berkshire SL1 4QZ

United Kingdom

Resources