How to run Nethserver on Amazon EC2

Requirement

  1. A working Amazon AWS Account
  2. Setting up the Amazon EC2 CLI on your pc (I’ve done it on my iMac machine)

Launch an updated Centos 6 Instance

I’ve done it with Amazon EC2 CLI following this tutorial

Step 1: create a key pair named nskey

ec2-create-keypair nskey

Step 2: create a security group

ec2-create-group nsgroup -d "Nethserver security group"

Step 3: add a rule to nsgroup Security Group for permit access to my instance via ssh to my public ip

ec2-authorize nsgroup -p 22 -s my-public-ip/32

You can find your public ip visiting this site http://checkip.amazonaws.com/

Step 4: Launching Centos 6 with update Instance
Search the ami id for the region you are interested for in this page and then run this command from your command line

ec2-run-instances ami-xxxxxxxx -t t1.micro -k nskey -g nsgroup

Now you can access via ssh to your new Centos instance via ssh

Access to you Centos Instance

With this command you can find at the 4th column of the output the address of your instance

ec2-describe-instances

It should be something like this

ec2-xxx-xxx-xxx-xxx.something.amazonaws.com

You should use it for accessing at the instance via ssh with the key created at step 1

ssh -i nskey.pem root@ec2-xxx-xxx-xxx-xxx.something.amazonaws.com

Update Centos and Install NethServer 6.6 Final

Update your Centos Instance

yum update -y

Then following the official instruction of Nethserver install NethServer

yum localinstall -y http://mirror.nethserver.org/nethserver/nethserver-release-6.6.rpm

and then

nethserver-install

To access at the Nethserver server-manager update the password of the root user with the command

passwd

Attention: with this comman you enable password access for your root user to ssh, bypassing key authentication. Remember to disable ssh password authentication via NethServer server-manager, uncheking the option in the SSH panel.

Open the access to the server-manager with this command via ec2 cli tools (from your pc)

ec2-authorize nsgroup -p 980 -s your-public-ip/32

then open your browser and access at the server-manager of your NethServer on Amazon AWS (the address is the same used to access via ssh)

https://ec2-xxx-xxx-xxx-xxx.something.amazonaws.com:980

NethServer quick install procedure suggest to change standard ssh port service (example with 2222 port). if you agree with this, remember to enable the access to this port with ec2-authorize command

ec2-authorize nsgroup -p 2222 -s your-public-ip/32

and then remember to indicate it in your ssh command connection

ssh -i nskey.pem root@ec2-xxx-xxx-xxx-xxx.something.amazonaws.com -p2222

And now… enjoy with NethServer on Amazon AWS :smiley:

9 Likes

WOW that’s a great howto! :smiley:

Nice Job!! that is something we definately need…

1 Like

Thank you @PParker :wink:

I’ve started this experiment without a particular goal andI was amazed how easy it was the setup of NethServer.

I’m not so expert of EC2, but I don’t exclude to make some other test installing some service on the instance.

It could be the field for some other how to… :wink:

1 Like

I have been installing a lot myself, I worry mostly about breaking the distro and if its stable. These are my main concerns as i press on

Thanks so much for posting this. I apologize if this is a stupid question, I’m still new to networking in general. But I thought you might have some advice. When trying to access the server-manager of the NethServer on Amazon AWS, the address keeps timing out. Any help would be much appreciated.

HI @ormuzd I’m happy for your interest.

Have you opened the 980 port access for your public ip from where you are trying to access?

In this quote you can find the procedure via cli tools.

You can do this setting also via web trought EC2 Management Console > Network & Security > Security Groups (help)

@etino - is this installation covered with EC2 free instance?

If I remember correctly, probably yes.

But it was just a test “for fun” to try the installation process of Nethserver on AWS and than I’ve not used the instance in a production environment.

If you are planning to use NethServer on EC2 for a project, you should scaling the instance for your needs.

I hope to be helpful :wink:

1 Like

A post was split to a new topic: Can’t reach other mashines through VPN on Amazon EZ2