This is a more opinionated post than usual: I live on the command line on Linux.
As such, I perform a few extra steps after a fresh installation to get to a “usable” system.
This is a more opinionated post than usual: I live on the command line on Linux.
As such, I perform a few extra steps after a fresh installation to get to a “usable” system.
Revision: 20240730-0 (init: 20240525)
This post discusses post-installation steps for a Ubuntu (Desktop, minimal install) Noble Numbat installation. Some will adapt to server instances. Please use its components as you see fit.
This is a quick guide to get some functionalities in place for using the OS.
Remote access
SSH
Desktop installs do not install openssh-server during setup. I want ssh access to this box:
sudo apt install openssh-server
After copying my .ssh keys over, I also sudo apt keychain
Tailscale
Tailscale is a Zero-Conf Virtual Private Network (VPN) that creates a NAT-traversal-capable Mesh Network over Wireguard. The IPs in your mesh are on the 100. subnet, a range of IP addresses reserved for Carrier-Grade NAT (CGNAT).
establishes a mesh network (their "tailnet") where each device connects directly to every other device.
leverages the WireGuard protocol, known for its speed and security, providing strong encryption for your network traffic.
I have been a Tailscale believer since 2021. I even wrote a piece on “rdesktop access on Unraid using a Jump Desktop RDC with an ssh-tunnel over Tailscale” in 2022.
Once you have your account, follow the Ubuntu Installation steps (you might need to sudo apt install curl first).
For remote access systems (or servers), it is also possible to Disable key expiry from your Machines dashboard’s host ... menu.
NextDNS
If you are a NextDNS.io customer, go to your https://my.nextdns.io/ page and look up the Linux’s “systemd-resolved” instructions.
Edit the /etc/systemd/resolved.conf file and enter the provided configuration data.
If you want to track the device, add its name before the NextDNS ID. For example, if you have something like DNS=IPv4or6#ID.dns.nextdns.io adapt it to show your HOST: DNS=IPv4or6#HOST-ID.dns.nextdns.io as described in the “Identify your devices” section of that page.
Restart the service for the changes to take effect: sudo service systemd-resolved restart
Remote Desktop: nomachine
The purpose of this remote desktop is to allow access to the remote screen from the login window, and to enable my user to perform operations on it. I used to be an x11vnc user. With the transition to Wayland, I started looking for alternate solutions, and settling on NoMachine which adds sound and dropping files from a system to another. Because I am the only person accessing the system, I only need one connection, be it other the local subnet (direct or Wireguard VPN) or Tailscale.
After downloading the .deb file for our x86_64 system, and sudo dpkg -i installing it, the tool will enable the NX service on port 4000.
Because we will likely have many interfaces created when we add Dockge to our system, we will edit the /usr/NX/etc/server.cfg file to modify the NXdListenAddress setting to only access the subnet IP of our host to used. There are many other settings that can be changed from the configuration file, please see https://kb.nomachine.com/AR02N00877 for additional details.
From the “NoMachine” application, select the “Settings → Server → Security” so we can control host access further:
Uncheck “Allow guest desktop sharing access to this server”
Uncheck “Only allow user connections for desktop sharing”
Check “Make access available when the system is still in the login screen”
Check “Don't require acceptance if the user logged in as a system user”
Downloaded .deb files do not install when double-clicking on them as in previous releases (test installing Chrome, 1Password, Visual Studio Code, or WaveBox’s .deb, for example). You can use the terminal and install those using sudo apt install <FULL_PATH>.deb
To regain the ability to open those files from the file manager, use the App Center application and search for the gdebidebian package.
When trying to use .AppImage files the first time, you will get an AppImages require FUSE to run error (test with Stacer‘s .AppImage, for example)
sudo apt install libfuse2t64 will solve this, and now you can start the tool.
Updating snap-store
A .snap file is a compressed SquashFS file system containing all the application's necessary files and directories in a compressed format.
Snap will automatically update its own applications (as long as they are closed), but updating itself often requires some help.
sudo killall snap-store
sudo snap refresh
Adding Flatpak support
A Flatpak file contains the entire application, including its binaries, libraries, and other dependencies. This ensures the application can run independently of the host system's libraries and configurations.
This will add flatpak support, and selecting the Install button from packages listed on https://flathub.org/ will allow you to install the downloaded files.
Note that at the time of this write-up, no noble version is yet available at https://ppa.launchpadcontent.net/flatpak/stable/ubuntu/dists/. As such, sudo nano /etc/apt/sources.list.d/flatpak-ubuntu-stable-noble.sources and replace noble by jammy on the Suites line.
brew became popular on MacOS and has been ported to Linux.
One reason to use brew is that although you might have an apt or snap version of many tools available, the brew version is likely more recent than the one available with those package managers.
For example, on 22.04, brew was required to get a recent version of podman to support the NVIDIA Container toolkit. On 24.04, apt info podman tells us we have 4.9.3, while brew info podman shows 5.0.3 available.
Follow the instructions at https://brew.sh/ to install the brew command (we recommend a sudo apt install git git-lfs before attempting to install it).
After following the recommended instructions (and performing the steps in the “Next steps” section of the installer), you can install a few useful tools (do a brew info NAME to get details on each tool)
nix-env is a unique and powerful package manager with a distinct approach to software installation and management; each package is defined using a purely functional language as a function of its inputs (dependencies), leading to deterministic and reproducible builds.
nix-shell is designed to create isolated and reproducible shell environments: you can test tools without installing them.
Each software is installed in its own directories, which support running multiple versions of the same tool. Each directory contains everything related to that installation. One key thing is that Nix guarantees that the same package build will always produce the same result, regardless of the machine or time.
To install the package manager component, see https://nixos.org/download/#nix-install-linux and follow the recommended post-installation instructions (including adding the start command to your .bashrc).
After your installation, select a package to install (you can see all available packages at https://search.nixos.org/packages). You can test a package before installing it. For example, with imgcat: nix-shell -p imgcat. After the installation, you will be in a [nix-shell:~]$ where you can check which imgcat and then run an imgcat /usr/share/plymouth/ubuntu-logo.png command. When you exit this shell, you will see that which imgcat shows that it is not available anymore.
To install the tool, follow the package’s nix-env “on Non NixOS” instructions; here nix-env -iA nixpkgs.imgcat. After this, which imgcat will show the tool available on your system.
We only discussed Nix as a package manager here; there is much more that Nix can do related to building content. Check https://nix.dev/tutorials/ to see more.
Shell
I have been onZ Shell since before it became the default shell for MacOS, and use the popular oh-my-zsh with powerline-10k
Z Shell
You can confirm it is installed on your host by trying to install it: sudo apt install zsh
To change your default shell to zsh use chsh -s /usr/bin/zsh
After installation, run it (type zsh) and follow the interactive “Z Shell configuration function for new users"
Oh-my-zsh
Oh My Zsh is a delightful, open source, community-driven framework for managing your Zsh configuration. It comes bundled with thousands of helpful functions, helpers, plugins, themes […]
isodate: prints ISO dates. Adds isodate and other commands
jsontools: JSON terminal tool. Adds pp_json and other commands
keychain: ssh-agent handler (requires keychain installation). You need to configure what agent it will run and the identities to use (before the plugin= line again), for example:
when installing “oh-my-zsh”, you might lose content from your original Zshell configuration file. This content should be in the .zshrc.pre-oh-my-zsh file. Copy its content at the beginning of your .zshrc file.
Similarly, you might find the Nix and Homebrew commands at the end of your .bashrc file (if bash was your original shell); please add those to your .zshrc before the plugins= since you might have installed the tools required by those plugins using brew or nix. Once done, ssh to your host to confirm everything is functional: no missing packages indicated by the shell prompt, nix-env -qa --installed "*" and brew list return some installed packages (if any).
Powerline10k
Powerlevel10k (p10k) is a popular theme for the Zsh shell that allows you to display various information segments (current directory, git status, time, system load, and more) on your command line.
Set ZSH_THEME="powerlevel10k/powerlevel10k" in ~/.zshrc
Open a new shell (if you have not logged out of your account since switching, you might need to start zsh) and follow the guided prompt to complete the configuration wizard. I do not enable “instant prompt” as I will add neowofetch to my interactive shells next.
When you restart your shell, you will see the enhanced prompt you decided on.
Edit the .p10k.sh file to see that you can edit the POWERLEVEL9K_LEFT_PROMPT_ELEMENTS and POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS to match your preferences (including adding more lines of context).
Interactive shells
At the end of your .zshrc add an interactive shell separator
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
Now, below this, we can add our aliases, or run commands that we want to be run at each next shell.
For example, neowofetch (installed by installing hyfetch).
Run it once to see information about your system. This will also create its default configuration file (at ~/.config/neofetch/config.conf), which you can edit to suit your needs (for example, display the gpu_driver, disk, local_ip, public_ip, users, and locale in the main section, or the memory_unit and add to thedisk_show).
In your .zshrc add after the interactive separator:
If case you are dual booting, you might want to check those two sites for helpful information:
Grub Customizer is a UI that will allow you to easily change the default boot option (or reorder options, including moving your preferred to the top). You can also see Ubuntu’s grub documentation.
Hosting on a VPS is a great option to run a blogging service, but installing services that might expose ports needs to be done with some precaution (or not at all if the service is only to be used by the server itself).
"Unattended Upgrades" is a package available on Ubuntu systems that automatically installs updates for security and, optionally, other software packages.
This tool is crucial for maintaining system security and stability. It ensures that vulnerabilities and bugs are promptly addressed without requiring manual intervention.
This post details the setup instructions for using it for security updates on an Ubuntu Linux 22.04 or 24.04 server and sending emails when the updates are completed.
Postfix is a free, open-source mail transfer agent (MTA) used to route and deliver email over the Internet.
FastMail is a paid service that provides a secure, privacy-focused email provider supporting custom domains.
This post details the setup instructions for using Postfix as a Send-Only SMTP server, using Fastmail, on a Ubuntu Linux 22.04 server.