Ubuntu Server Setup

Some Personal Preferences

Updated: 03 September 2023

SSH Setup

1. Install SSH

Terminal window
1
sudo apt update
2
sudo apt install openssh-server

Note using this SSH server you also connect for remote development using VSCode Remote Development, Additionally you can install the VSCode docker extension to work with docker on the server

2. Check SSH Status

Terminal window
1
sudo systemctl status ssh

3. Start/Stop SSH Server

If the SSH server is not working for some reason you can stop/start as needed

Terminal window
1
sudo systemctl stop ssh
2
sudo systemctl start ssh

4. Log in From Remote

You can log in using the following command from a machine with SSH installed

Terminal window
1
ssh username@ipaddress

Your username will be the same as your Ubuntu UN, and the IP can be found by running the following commmand on the Server

Terminal window
1
ip address | grep inet

Or more easily using

Next use the relevant inet ip address of the form x.x.x.x, e.g. 192.168.0.2

You should also be able to access applications running on this server on their respective ports at the relevant IP

RDP Setup

From Windows using RDP you will need to first install and activate the RDP Client, this can be done with

Terminal window
1
sudo apt install xrdp
2
sudo systemctl enable xrdp

Then connect from RDP with the server IP and Username/Password

This is currently untested

Open Ports

You can allow ports through your firewall (if this is a problem) with the following commans

Terminal window
1
# sudo ufw allow <PORTNUMBER>
2
sudo ufw allow 8080
3
sudo ufw status

VS Code Server Setup

Leaving this here for reference but just note that if you are using the VSCODE Remote development extension this will be automatically installed on the server IDK how it connects though ~ I think using SSH (who knows)

You can run code-server using a Docker Image with the following command

Terminal window
1
docker run -it -p 8443:8443 --name vscode -v "${PWD}/repos:/home/coder/project" -d codercom/code-server --allow-http --no-auth

Docker

I have not tested this installation method but it looks like docker provides an installation script that you can use on GitHub

To use it you can run the following:

1
curl -fsSL https://get.docker.com -o get-docker.sh
2
sh get-docker.sh

Jenkins

Configuring Jenkins on an Ubuntu server can be done by following these instructions, or the following steps below:

Terminal window
1
sudo apt update
2
sudo apt install openjdk-8-jdk
3
wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -
4
sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
5
sudo apt update
6
sudo apt install jenkins

You can then verify it is running with

Terminal window
1
systemctl status jenkins

You can then go through the normal Jenkins Setup. Note that the initial admin password can be found with:

Terminal window
1
sudo cat /var/lib/jenkins/secrets/initialAdminPassword

After installation be sure to add the Blue Ocean Plugin. Otherwise like what are you even doing? You can do that from Configure >