How to Install Parse Server on Ubuntu 16.04

By Hitesh Jethva, Alibaba Cloud Tech Share Author. Tech Share is Alibaba Cloud’s incentive program to encourage the sharing of technical knowledge and best practices within the cloud community.

Parse server is a free and open source Mobile Backend as a Service platform originally developed by the provider Parse, Inc. You can deploy Parse server to any infrastructure that can run Node.js and can be added to existing web applications. Parse Server is a new project, separate from the hosted Parse API service. Its main aim is to provide and support the growth of an open-source API server, and allow new developers to benefit from the powerful Parse client SDKs regardless of where their application logic and data is stored. Parse server comes with a lot of features such as, analytics, global configuration, push notifications, background jobs, system emails and much more.

In this tutorial, we will learn how to install Parse Server on an Alibaba Cloud Elastic Compute Service (ECS) Ubuntu 16.04 Server

Prerequisites

  1. A fresh Alibaba Cloud ECS Ubuntu 16.04 instance.
  2. A static IP address is configured.
  3. A root password is set up to your instance.

Launch Alibaba Cloud ECS Instance

First, log in to your Alibaba Cloud ECS Console. Create a new ECS instance, choosing Ubuntu 16.04 as the operating system with at least 2GB RAM. Connect to your ECS instance and log in as the root user.

Once you are logged into your Ubuntu 16.04 instance, run the following command to update your base system with the latest available packages.

Install MongoDB

You will need to install the MongoDB database server to your system. By default, MongoDB is not available in the Ubuntu 16.04 default repository. So, you will need to add the PPA for that.

First, install the required packages with the following command:

Next, add the MongoDB repository with the following command:

Update the repository and install MongoDB server using the following command:

Once the installation is completed. You can check the MongoDB status with the following command:

Output:

Install Node.js

By default, Node.js is not available in the Ubuntu 16.04 default repository. So, you will need to add the PPA for that. You can do this with the following command:

Once the repository is installed, install Node.js with the following command:

Update the NPM packages to the latest version by running the following command:

Install and Configure Parse Server

Download the example parse server from Git repository with the following command:

Change the directory to the parse-server-example and install all nodejs dependencies using the following command:

Once the installation has been completed, you should see the following output:

Next, fix some vulnerabilities using the following command:

Output:

Test Sample Application

All the Node.js dependencies are now installed. It’s time to test sample application. You can test it by running the following command:

Once the server starts, you should see the following output:

Your Parse server is now up and listening on port 1337. Let’s perform some tests to make sure it’s running.

Add some values to Parse server using the curl command.

Output:

This command will connect to parse server and records will be saved to MongoDB database.

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

If everything goes fine, you should see the following output:

Configure Sample Application

Create a sample app with name testapp.js:

Add the following lines:

Save and close the file. Then, run the app with the following command:

Output:

Test the testapp with the following command:

Output:

That’s it! Parse Server is now successfully installed on your Alibaba Cloud Elastic Compute Service (ECS) Ubuntu 16.04 Server.

Reference:https://www.alibabacloud.com/blog/how-to-install-parse-server-on-ubuntu-16-04_594338?spm=a2c41.12498581.0.0

Follow me to keep abreast with the latest technology news, industry insights, and developer trends.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store