How to get a Free Server for a Machine Learning model | by Roman Orac | Towards Data Science

Having an always-on server is a great way to show your references to your future employers or to test your Machine Learning model in the real world.
Before we start I would like to disclose that I’m NOT affiliated with Amazon in any way. The approach you’ll learn in this article should be also applicable to other cloud providers (eg. Microsoft Azure, Google Cloud Platform).
I wrote this article because I feel it is important that you have this knowledge. I wish someone would teach me this in my college days when I had too much time and no money.
What is AWS?
How to create an AWS account?
How to start a free server anywhere in the world?
How to configure the server?
How to connect to the server?
Few tips on how to write the server code.
Amazon Web Services (AWS) is a subsidiary of Amazon providing on-demand cloud computing platforms and APIs to individuals, companies, and governments, on a metered pay-as-you-go basis.
These cloud computing web services provide a variety of basic abstract technical infrastructure and distributed computing building blocks and tools. AWS offers reliable, scalable, and inexpensive cloud computing services all around the world.
AWS has a special offer for new users. You can run a small server instance for free for 1 year.
Start by creating an Amazon Web Services account. You will need a credit card to register. It can take some time to get verified.
Sign in to your AWS account.Select EC2 in AWS Management Console.
Sign in to your AWS account.
Select EC2 in AWS Management Console.
Click on the Launch Instance button.Choose an Amazon Machine Image (AMI):Select Amazon Linux 2 AMI (HVM), SSD Volume TypeChoose an Instance Type:General purpose t2.micro Free tier eligibleClick Review and Launch.Review Instance Launch:Click LaunchSelect an existing key pair or create a new key pair:In Choose an existing key pair select box select: Create a new key pair.In Key pair name type: my-model.Click Download Key Pair and Launch Instances.
Click on the Launch Instance button.
Choose an Amazon Machine Image (AMI):Select Amazon Linux 2 AMI (HVM), SSD Volume Type
Choose an Instance Type:General purpose t2.micro Free tier eligible
Click Review and Launch.
Review Instance Launch:Click Launch
Select an existing key pair or create a new key pair:In Choose an existing key pair select box select: Create a new key pair.In Key pair name type: my-model.Click Download Key Pair and Launch Instances.
Click on the View instance button.Open the terminal on your personal machine (Command Prompt if you are using Windows) and locate your key that you downloaded before (Download folder). To move to Downloads folder in the terminal run:
Click on the View instance button.
Open the terminal on your personal machine (Command Prompt if you are using Windows) and locate your key that you downloaded before (Download folder). To move to Downloads folder in the terminal run:
cd Downloads
3. Set permissions for your key (skip this step if you are using Windows):
chmod 400 my-model.pem
4. Wait that your instance gets to running state:
1. Select the instance and click the Connect button (remember the instance IP as you will need it later on).
2. On personal machine’s terminal window: copy the command for connection from Example (you see this example when you click on Connect button) on AWS and paste it to the terminal on your personal machine to connect to AWS instance: It should look something like this:
ssh -i "my-model.pem" ec2-user@XX-XX-XXX-XX.compute.amazonaws.com
Type yes if asked: Are you sure you want to continue connecting (yes/no)?
When successfully connected to AWS instance, you should see this ASCII art:
Update instance if necessary: sudo yum update -y.
Update instance if necessary: sudo yum update -y.
If you plan to run a web server on the instance make sure you open inbound ports so that you will be able to access it from a web browser. In the example below, I open ports 5000 which is for the Flask Web framework.
Click Services, select EC2, select Running instances and scroll to the right and click on the Security Groups link of your instance:
Click Services, select EC2, select Running instances and scroll to the right and click on the Security Groups link of your instance:
An empty server is not much better than no server.
To deploy a Data Analytics Server based on pandas, see:
towardsdatascience.com
A real-world project in production is worth more than a certificate from an online course. That is the reason I’ve written Your 1st Machine Learning Model in the Cloud.
The Your 1st Machine Learning Model in the Cloud will teach you how to develop and deploy a Machine Learning model to a server in the Cloud.
- How To Create Date Series in SQL [Article]- Free skill tests for Data Scientists & Machine Learning Engineers- Advance your Career in Cybersecurity (60% off) [Course]- Become a Cloud Developer using Microsoft Azure [Course]- Master SQL, the core language for Big Data analysis [Course]
Some of the links above are affiliate links and if you go through them to make a purchase I’ll earn a commission. Keep in mind that I link courses because of their quality and not because of the commission I receive from your purchases.
Follow me on Twitter, where I regularly tweet about Data Science and Machine Learning.