Skip to main content

How to set up an NREC instance from scratch

Description

Below we will show how to set up a new NREC instance and creating a Linux virtual machine (VM) suitable for running both static and dynamic web pages. We also cover which settings we prefer for our machines, which to date is not covered in the official NREC docs.

0. Before starting

Go to https://www.nrec.no/ and log in using Dataporten/FEIDE. By default, all new users have a DEMO instance available. Please take note that choosing the region (bgo/osl) from the dropdown menu in the top left affects which instances are available. To start a new instance, click "instances", then click "Launch instance"

1. Creating a new instance on NREC

Fill out the necessary fields. It is advised to give a meaningful instance name which relates to the role of this VM. Count: if you expect high traffic, it is recommended to use a count higher than 1.

alt text

2. Choosing which instance of Linux to run

For our uses, we normally choose GOLD Debian 12. alt text

3. Other settings

Choose flavour (Small is recommended for static pages, medium for more demaning websites where you expect larger traffic.) alt text

Choose DualStack alt text

4. Key-pairs

Give a meaningful name to make it clear which computer has a connection to the VM. For more on SSH key pairs, visit the Software Carpentry course page on Version Control with Git. Choose a key pair, by clicking connect Key Pair, then paste the key text or upload the file. alt text

Then click "Launch instance"

5. Creating security groups

Lets move over to Network -> Security groups. We will first create the security groups we need here, and later go back to our server instance and apply them.

Then, we will create security groups for SSH to allow an SSH-connection from outside computers:

  1. alt text
  2. alt text then, we create one for http: alt text

In the end, it should look like this: alt text

alt text

then specify that the security groups should be used: alt text

Also remember to fill in the following:

image text 1
Test-caption for the above image

NOTE: With the settings above, you will probably receive a warning email from NREC about a "Problematic security group rule". Considering the settings we use here are appropiate for web site hosting, which we wish to be open for the general public, we can ignore this warning.

6. Connecting to the VM

Open a new shell, and try connect via ssh debian@[IP-address], which is found in image-13 (in this case ssh debian@158.39.74.231)

run sudo apt update, then sudo apt upgrade to install various useful tools for your Linux instance, which should be done regularly to keeep the machine updated. When prompted, "install package maintainers version"