Basic setup of bare Ubuntu 24.04 machine
Refreshes package lists and installs the latest security and system updates.
I like to create an alias first to make this easier in the future
nano ~/.bashrc
# paste this
alias update="sudo apt update && sudo apt upgrade -y"
# restart shell or source the profile
source ~/.bashrc
# Then run the updates
updateInstalls essential command-line tools.
sudo apt install -y curl wget ca-certificates gnupg git unzipFrees disk space by removing unused packages and temporary files.
sudo apt autoremove -y && sudo apt cleanUncomments deb-src lines in /etc/apt/sources.list to allow source code downloads for packages.
sudo sed -i 's/^#.*deb-src/deb-src/' /etc/apt/sources.listAdds automatic updates, firewall, and intrusion prevention tools.
sudo apt install -y apt-transport-https fail2ban ufw unattended-upgradesEnables automatic installation of security updates.
sudo dpkg-reconfigure --priority=low unattended-upgradesProvides compilers, shell enhancements, and developer tools.
sudo apt install -y build-essential zsh neovim htop tmux tree ripgrep fd-find
## These are optional but can be nice to have!
# Install fast for checking internet speed
sudo snap install fast
# Install neofetch for system information
sudo apt install neofetch
# Install nload for monitoring network traffic
sudo apt install nload
# Install glances for monitoring system resources
sudo apt install glancesThis installs and connects Tailscale for secure networking and remote access on WSL.
For instructions on other Linux systems, see here
# Download it
curl -fsSL https://tailscale.com/install.sh | sh
# it should install, then you can just run this command and log in via browser
sudo tailscale up💡 Once connected, this machine will appear in your Tailscale admin console.
You can securely SSH into it using its Tailscale IP or hostname from any other Tailscale-connected device.
Creates a secure SSH directory and generates an ED25519 key for GitHub authentication.
mkdir -p ~/.ssh && chmod 700 ~/.ssh
ssh-keygen -t ed25519 -C "[email protected]"
cat ~/.ssh/id_ed25519.pubThen add what is shown to your GitHub account or other service requiring authentication.
Next, set up git credentials:
git config --global user.name "Dominic Owens"
git config --global user.email "[email protected]"Tests SSH access to GitHub by cloning and removing a repo.
git clone [email protected]:d0minicO/d0minico.github.io.git
ls
# If it looks good, you can safely delete and then work on repos wherever
rm -rf d0minico.github.io/Sets firewall defaults to deny all incoming connections and allow outgoing, then enables it.
Not necessary for WSL.
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw enable
sudo ufw status verboseNext, follow the instructions here to setup conda/mamba