Setting up Your NREC VM for web development when logging in for the first time
After you have created an instance on NREC, ssh to the instance, by running
ssh debian@[IP-address]
the IP-address can be found by choosing the "Instances" sidebar while logged in at the NREC dashboard.
First time logging into your new NREC instance
Updating the VM
To install a series of useful packages and tools, first run:
sudo apt update
and then
sudo apt upgrade
These commands might be useful to run from time to time to make sure all packages on your VM is up to date.
Creating a new user
As a general rule, it is not recommended to deploy the webpage with a sudo rights enabled user. As such, it is good practice to create a new user for where development and deployment will be managed. Furthermore, if multiple people are to access the VM, it is good practice to have a separate account per user of the VM.
To create a new user, use the command
sudo adduser <username>
You will be asked a series of questions, such as entering and confirming a password. Other questions (like room number, etc) may be left blank. To make a user without a password, use the following flag:
sudo adduser <username> --disabled-password
This new user can write, edit and delete files and directories within the home directory. As a general rule, this user should also not have push-privileges to any associated GitLab/GitHub repositories.
Install Python
Python3 might already be installed on the VM, but however, python3, and not the command python will be the only working way in invoking the program to start. To fix this, run
sudo apt install python3 python-is-python3