../bootstrap-ubuntu

Bootstrap Ubuntu

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

Prequisites

Install any updates.

sudo apt-update
sudo apt-upgrade

Remote 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.

Install an SSH server

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:

Host anker
    Hostname 192.168.2.22
    User pcampbell

Test that you can ssh to the server:

ssh anker

Exit and return to the local machine.

Add my public key

Add public key to server:

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):

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

Run the following commands on the server.

Rust

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

cargo install rtx-cli

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

Yadm

rtx global yadm@latest
rtx install

Now clone the yadm dotfiles repo:

$(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:

~/bin/bootstrap all

Install Desktop software

If using the machine as a desktop.

Install Docker

These are the instructions from docker.com

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