Deploy Flojoy Cloud to AWS
Flojoy Cloud is the easiest way to supercharge your test & measurement data with powerful data visualizations, collaboration, and easy to use APIs for Python, LabVIEW, and MATLAB.
You can use our public Flojoy Cloud instance for your test and measurement data here: https://cloud.flojoy.ai
Additionally, you can deploy your own Flojoy Cloud instance with our public AWS AMI. In this tutorial weâll show you how with few very straightforward steps - all you need is an AWS account.
Prerequisites
-
An AWS account.
-
Active AWS SES with domain (For sending verification emails).
-
An IAM role with proper SES policy. (Weâll describe this in next step)
-
Enabled Google Oauth2.0 API. See here
-
A valid domain (For SSL and HTTPS connection).
-
A PostgreSQL instance in AWS RDS (You can setup your own postgresql db as well)
Create IAM role
-
Log in to AWS account and Search for
IAM
, then go toIAM
dashboard. -
From left sidebar click on
Policies
. -
Now click on
Create Policy
. -
Now click on
JSON
button from right top ofPolicy Editor
section. -
Paste following data to input box:
-
Provide a Policy name and click
Create Policy
. -
Now click on
Roles
from left sidebar. -
Click on
Create Role
. -
Select
AWS Service
andEC2
inuse case
section then clickNext
. -
Now search for just created policy name and select it then again click
Next
. -
Give a Role name and click on
Create Role
Done! weâve created an IAM role for SES service which we can attach with our EC2 instance to allow cloud app to send verification emails.
Steps to deploy on AWS
-
First, Log into your AWS account. And head to EC2 dashboard. You can use search bar from top left corner for this. Just type
ec2
and youâll find the link for EC2 dashboard. -
From left side bar select AMIs. Then change AMI type from
owned by me
topublic images
from dropdown before AMI search bar.
- Now, in the AMI search input type for
Flojoy-Cloud-AMI
and youâll find our public AMI for cloud app. Select it then click onLaunch instances from AMI
.
-
In the next page, provide a name to your instance. In
instance type
section select at leastt3.xlarge
( 4vCPU and 16GiB ram) to allow app run smooth and fast. -
In the next section select a key pair for SSH purpose. After that in
Network
section selectAllow HTTP traffic from the internet
,Allow HTTPS traffic from the internet
andAllow SSH traffic from
option.
- Scroll down and click on
Advanced details
to expand that section.
-
Select the IAM role just created with custom SES policy in
IAM instance profile
option. -
Then head to
user data
input at the bottom ofAdvanced details
section and paste following bash script with valid domain name.
-
Almost there! now click on
launch instance
button. -
Weâre done with launching instance from Flojoy Cloud AMI. Now weâre only two steps away from getting our app ready.
Setup Credentials
Credentials are required for cloud app to run. So we need to setup our own credentials. Letâs do that in real quick with a few steps:
-
Go to EC2 dashboard from left sidebar. Then click on just launched instance and copy public ip.
-
Now connect to your EC2 instance with key-pair previously selected during configuring instance. Run following command to connect:
- Enable
root
mode:
- Now open
/root/cloud/.env
file with your preferable editornano
orvim
and paste following template with valid credentials:
- Restart Cloud app service:
This will build the app with new credentials and start the app.
Enable HTTPS
We have deployed our own version of Flojoy cloud app. Now to allow app work properly we need to configure SSL on launched EC2 instance. Letâs do that:
- Go to you domain provider website and add an âAâ record in your domain with the public ip of just launched EC2 instance.
- Now connect to your EC2 instance with key-pair previously selected during configuring instance. Run following command to connect:
- Enable
root
mode:
- Install
Certbot
:
- Prepare
Certbot
:
- Get and install SSL certificate:
And follow on screen instruction. This will get and install SSL certificate.
- Restart Nginx:
Now visit https://your-domain.com
and you should able to see Flojoy cloud app.
Having issues with deployment? Join our Discord Community and we will help you out!