• Home
  • Disclaimer
  • Contact
  • Archives
  • About
  • Subscribe
  • Support
  • Advertise

Kernel Talks

Unix, Linux, & Cloud!

  • How-to guides
    • Howto
    • Disk management
    • Configurations
  • OS
    • HPUX
    • Linux
  • Commands & tools
    • Commands
    • Software & Tools
    • System services
  • Cloud computing
    • AWS CSA preparation guide!
    • Cloud Services
  • Tips & Tricks
  • Linux commands
You are here: Home / Virtualization

How to open port on AWS EC2 Linux server

Published: March 9, 2017 | Modified: June 29, 2020 | 20,999 views



Small tutorial with screenshots that show how to open port on the AWS EC2 Linux server. This will help you to manage port-specific services on the EC2 server.

Open ports for EC2
Open port on AWS EC2 Linux

AWS i.e. Amazon Web Services is no new term for the IT world. It’s a cloud services platform offered by Amazon. Under its Free tier account, it offers you limited services free of cost for one year. This is one of the best places to try out new technologies without spending much on the financial front.

AWS offers server computing as one of their services and they call them EC (Elastic Computing). Under this, we can build our Linux servers. We have already seen how to set up a Linux server on AWS free of cost.

By default, all Linux servers build under EC2 has post 22 i.e. SSH service port (inbound from all IP) is open only. So, if you are hosting any port-specific service then the relative port needs to be open on the AWS firewall for your server.

Also, it has port 1 to 65535 are open too (outbound for all traffic). If you want to change this you can use the same below process for editing outbound rules too.

Setting up a firewall rule on AWS for your server is an easy job. You will be able to open ports in seconds for your server. I will walk you through the procedure with screenshots to open a port for the EC2 server.

Step 1

Log in to the AWS account and navigate to the EC2 management console. Go to Security Groups under Network & Security menu as highlighted below :

Security groups in EC2 dashboard
AWS EC2 management console

Step 2

On Security, Groups screen select your EC2 server and under Actions menu select Edit inbound rules

SG list
AWS inbound rules menu

Step 3

Now you will be presented with an inbound rule window. You can add/edit/delete inbound rules here. There are several protocols like HTTP, nfs, etc listed in the drop-down menu which auto-populate ports for you. If you have customer service and port you can define it too.

Inbound rule in SG
AWS add inbound rule

For example, if you want to open port 80 then you have to select :

  • Type: HTTP
  • Protocol: TCP
  • Port range: 80
  • Source: Anywhere (Open port 80 for all incoming req from any IP (0.0.0.0/0),  My IP: then it will auto-populate your current public internet IP

Step 4

That’s it. Once you save these settings your server inbound port 80 is open! you can check by telneting to port 80 for your EC2 server public DNS (can be found it EC2 server details)

You can also check it on websites like ping.eu.

The same way outbound rules can be edited too! These changes are active on the fly and don’t need any downtime.

⇠ Previous article
How to download the package using YUM or APT
Next article ⇢
Package removal in Linux (YUM & APT)

Related stuff:

  • Create access keys in AWS
  • AWS CloudFront, SNS, SQS revision before the CSA exam
  • Amazon ECR: Creating repository and pushing first container image
  • Complete AWS CSA Associate exam preparation guide!
  • How to install VMware Tools on Linux guest machine
  • AWS VPC Creation along with screenshots
  • How to add EBS disk on AWS Linux server
  • How to create a user with programmatic access in AWS
  • How to reset iptables to the default settings
  • Bastion host in AWS
  • AWS VPC, Route53, IAM revision before the CSA exam
  • How to extend EBS & filesystem online on AWS server

Filed Under: Cloud Services, Virtualization Tagged With: enable service on ec2 server, enable telnet for ec2 linux server, how to enable port on aws server, how to open port on aws

If you like my tutorials and if they helped you in any way, then

  • Consider buying me a cup of coffee via paypal!
  • Subscribe to our newsletter here!
  • Like KernelTalks Facebook page.
  • Follow us on Twitter.
  • Add our RSS feed to your feed reader.

Share Your Comments & Feedback: Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Get fresh content from KernelTalks

  • Email
  • Facebook
  • RSS
  • Twitter

Popular posts

  • How to start, stop & restart MariaDB server in Linux
  • How to list YUM repositories in RHEL / CentOS
  • How to reset iptables to the default settings
  • How to rescan disk in Linux after extending VMware disk
  • 4 ways to check the size of physical memory (RAM) in Linux
  • How to configure login banners in Linux (RedHat, Ubuntu, CentOS, Fedora)
  • How to remount filesystem in the read-write mode under Linux
  • What are the huge pages in Linux?
  • mount.nfs: requested NFS version or transport protocol is not supported
  • MobaXterm X11 proxy: Authorisation not recognised

Get Linux & Unix stuff right into your mailbox. Subscribe now!

* indicates required

This work is licensed under a CC-BY-NC license · Privacy Policy
© Copyright 2016-2020 KernelTalks · All Rights Reserved.
The content is copyrighted to Shrikant Lavhate & can not be reproduced either online or offline without prior permission.