Set up AWS EC2 Parse Server in Android
date
Mar 15, 2022
slug
setup-aws-parse-server
status
Published
tags
AWS
Android
Server
Tutorial
summary
type
Post
I learned Android along with The Complete Android Oreo Developer Course and was stuck in the Instagram Clone chapter when I tried to set up the AWS EC2 Parse Server.
After googling many times, I finally figured it out and got access to the Parse Dashboard.
Connect to the instance using SSH client
In Amazon Dashboard choose
Instances
from the left sidebar, and then select the instance we would like to connect to.

We can just follow the instruction above, but there might be some unexpected problems.
So refer to the steps below:
- Open the terminal and locate the private key file
Check the
.pem.txt
file we’ve just downloaded when creating a new key pair.Remove the “.txt” behind to keep it as a
.pem
file. This .pem
file is our private key file.Then open up the terminal and get to where the file is. In my case it’s on the desktop:
- Change the permissions of the
.pem
file so only the root user can read it
- Connect to the instance using its Public DNS
In this step, simply copying the command in the instruction might get errors.
We should verify that we are connecting with the appropriate user name for our AMI.
In my case:
If we see something on our terminal screen like this:

That means we’ve successfully connected to our instance.
Do some setup
Once we get to that screen, we need to move into where the parse code is, to do some setup:
Next, we have a file that we need to edit:
Inside the file, we can see the information of the server:

We can paste the information required to initialize the Parse Server in our android application.
Connect to the Parse Dashboard
We should be able to visit the Parse Dashboard by surfing to our server public IP address (which we can get from the AWS console) in our browser.


Get the user name and password in the terminal:

Configure publicServerURL
Let’s say we upload a photo to the parse server.
When we click on the image link, it opens up a url using the localhost IP again.


That’s a problem. Because it means we can not get access to the photo in our program.
When using files on Parse, you will need to use the publicServerURL option in your Parse Server config. This is the URL that files will be accessed from, so it should be a URL that resolves to your Parse Server. Make sure to include your mount point in this URL.Parse's Documentation
The
publicServerURL
is explicitly required for those cases. Parse server injects the publicServerURL
for all our files at runtime.Every file URL is replaced at runtime, with the full URL. If we set the
publicServerURL
, this will be set in all the responses.All we have to do is adding the
publicServerURL
parameter to the server.- Open the
config.json
file
- Add a new line below the
serverURL
parameter
- Save it and restart Parse running
Now we can refresh the Parse Dashboard page, and can get to the right URL to download photos successfully.