Contents

Bootstrap Ubuntu

My rough notes on bootstrapping a plain Ubuntu instance into my dev environment.

Prequisites

  • Ubuntu 22.04 (I use Ubuntu MATE)
  • My user with sudo permissions

Install any updates.

1
2
sudo apt-update
sudo apt-upgrade

Remote Access

  • Pin the IP address
  • Install an SSH server
  • Add my public key
  • Verify SSH access

Pin the IP address

Currently my internal network is managed by [eero].

Verify that, if using WiFi, that I’m connected to the correct WiFi network.

  • Open [eero] app on phone
  • Settings
  • Network Settings
  • Reservations & port forwarding
  • Add a Resrvation
  • Select device
  • Save

Install an SSH server

1
sudo apt install openssh-server molly-guard

Assuming the hostname is anker with an IP address of 192.168.2.22:

Add host details to ~/.ssh/config:

1
2
3
Host anker
    Hostname 192.168.2.22
    User pcampbell

Test that you can ssh to the server:

1
ssh anker

Exit and return to the local machine.

Add my public key

Add public key to server:

1
2
ssh-copy-id -i ~/.ssh/id_rsa anker
ssh-copy-id -i ~/.ssh/id_ed25519 anker

Verify SSH access

Verify that you don’t need to enter your password (assuming your ssh-agent is working):

1
ssh anker

Configure home directory

I use [yadm] to track my user settings, although I want to have a look at [chezmoi] as a possible alternative.

  • Install rust, rtx and yadm
  • Clone yadm dotfiles
  • Verify submodules
  • Verify ssh access retained
  • Verify neovim config loaded

Install rust, rtx and yadm

Run the following commands on the server.

Rust

1
2
sudo apt install curl git direnv keychain
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shcurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Quit and restart ssh and verify ~/.cargo/bin/ is in your PATH.

RTX

1
cargo install rtx-cli

Note, when using NuShell, I’m not able to run rtx without specifying the full path, ~/.cargo/bin/rtx.

Yadm

1
2
rtx global yadm@latest
rtx install

Now clone the yadm dotfiles repo:

1
2
3
4
5
6
7
8
$(rtx which yadm) clone --depth 1 --recursive git@git.kemitix.net:kemitix/dotfiles-yadm.git 
$(rtx which yadm) checkout $HOME
$(rtx which yadm) enter
git submodule update --init --recursive
cd ~/.config/nvim/lua
ln -s ~/.config/nvim-lua-user/ user
exit
rtx install

Boostrap

Run the bootstrap:

1
~/bin/bootstrap all

Install Desktop software

If using the machine as a desktop.

  • Vivaldi
  • Thunderbird

Install Docker

These are the instructions from docker.com

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
sudo apt-get remove docker docker-engine docker.io containerd runc
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
echo \
  "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
  "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo docker run hello-world