Setting Up a Fresh Ubuntu 21.04 Desktop as Personal Computer

Setting Up a Fresh Ubuntu 21.04 Desktop as Personal Computer

Posted 6 months ago in Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial, Linux, Ubuntu, Setup, Tutorial

I recently got a brand new personal laptop (hooray bonus!) and got a suggestion for a blog post about setting up my Ubuntu for personal use. It's been a while since I shared these types of posts, so I thought it would be fun to write about my new setup.

I've been an Ubuntu user for a long time, it is a system where I feel very comfortable so that means it also makes me more productive. I decided to try the newest release, the brand new 21.04 a.k.a Hirsute Hippo. In this post, I share all my setup process.

Hirsute Hippo

Getting Started

Well, the first step is to get the system all installed and set up.

As I mentioned previously, I chose the newest 21.04 release of Ubuntu, also known as Hirsute Hippo. You might want to go with the LTS (20.04) version if you don't plan on upgrading / reinstalling your system before 22.04 is out (the next LTS). The advantage of the 21.04 version is because it's already one year newer than the LTS, so the software that it comes with and the default apt packages for the distro are already bleeding edge, so you can install most things via apt without worrying that it's all outdated.

Installation Remarks

Because this is a new laptop, I didn't need to do any backup, but if you are going to do this on your existing system please don't forget about it :)

I always choose full disk encryption when installing Ubuntu, this is an option that will show up when choosing installation type and partitions. This adds extra security to your system, just be sure you keep your decryption key safe otherwise you will lose access to your entire system!

Priority Installs

Depending on which Ubuntu version you're installing, you may need to update the system right after installation to make sure you have the most updated version of the software you're going to use. You will get a notification from Ubuntu if updates are available for your system as soon as you log in.

Now it's time open the terminal to install a few basic packages right away:

sudo apt update
sudo apt install vim git unzip curl ffmpeg

Then, onto more interesting things.

Terminator and Oh-My-Zsh

Next, I like to set up my terminal and shell. I've been using Terminator for years, I really like to be able to split the screen in multiple ways and Terminator is a lot easier to use than tmux for me. I'm also a big fan of oh-my-zsh and have been using it for many years.

So the first thing is to install zsh and terminator.

sudo apt install zsh terminator

Then, you can run the Oh-my-Zsh installation script, which will also set zsh as your default shell:

$ sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

The theme I like is called agnoster, and to use that theme you'll need to install Powerline fonts. To install these, you'll need to clone their repo and run the install script:

cd /tmp
git clone https://github.com/powerline/fonts.git
cd fonts/
./install.sh

Then, you can edit your .zshrc to change to the agnoster theme:

vim ~/.zshrc
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
ZSH_THEME="agnoster"

Don't forget to save the file (with vim, type ESC then :wq to save).

You can now close the old terminal and open terminator! You'll need to change the font to one of the Powerline patched fonts you just installed, otherwise the prompt won't show up correctly.

To customize your Terminator appearance, right-click and go to Preferences -> Profiles and unmark the checkbox that says Use the system fixed width font. Then choose the font (tip: search for "powerline" to show only the powerline-compatible fonts).

Screenshot of Terminator settings

While you're at it, you can also adjust background (I like to set up transparency to 85%).

This is the final result:

Terminator + Oh-my-zsh agnoster theme

SSH Setup

It is a good idea to set up a new SSH key if you are setting up a fresh new system. This GitHub Doc Page contains detailed instructions on how to set a new SSH key with the Ed25519 algorithm and add it to the SSH-agent.

If you are using GitHub, it's also a good moment to add the new key to your account (go to Settings -> SSH and GPG Keys).

Git Setup

To use Git from the command line, you'll need to configure your Git name and email address in order to do commits and pushes.

git config --global user.name "Your Name"
git config --global user.email "email@example.com"

Development Setup

Nowadays I typically have only a basic php-cli installed on my system, and I use Docker + Docker Compose to run my full development environments. This tutorial from my friend Brian explains in detail how to get Docker installed on Ubuntu 20.04.

With Docker installed you can follow my tutorial on How to Install Docker Compose to get Docker Compose also set up.

If you'd like a basic PHP env for the command-line as well, you can install php-cli and a few basic extensions from your terminal:

sudo apt install php-cli php-mbstring php-gd php-curl

Setting Up Jetbrains PhpStorm (IDE)

I've been using Jetbrains PhpStorm for many years, it is my favorite IDE (all from Jetbrains actually, since I've used RubyMine in the past too). Downloads are available in AppImage format, which is really helpful.

You can download PhpStorm as a trial too, if you'd like to try it out before buying a license. Once you've downloaded the package, just unpack it to somewhere in your home dir and run it with:

./PhpStorm-211.7142.44/bin/phpstorm.sh

You can now install a desktop entry to PhpStorm by going to Tools -> Create Desktop Entry.

Now the fun starts, with theme choosing etc. Installing plugins on PHPStorm

The editor font size is always too small for me, so I like to adjust it to a bigger size. I've been using JetBrains mono size 20, and I also like to enable ligatures, I think it gives a nice look to some portions of code.

Adjusting font size

Other Software Installs

Because this is a personal laptop and I am a person of many hobbies, I will have a great mix of software here including video editing, graphics design, 3D design, and development (IDEs) software.

Nowadays, most desktop applications for Ubuntu/Debian are being distributed as AppImage files, which are quite easy to work with. I usually create an Apps folder in my home dir to save these applications.

mkdir ~/Apps

Some of them still use more traditional distribution methods, like Gimp which can be installed via apt.

So here is a list of other applications that I got installed right away, organized by category:

Graphic Design

  • Inkscape - Vector Graphics. Available as AppImage.
  • MyPaint - Drawing and Painting. Available as AppImage.
  • Gimp - Graphic Design, photo manipulation. Installed via apt.

Video and Streaming

  • Peek - Simple screen recording, records in gif or mp4. Installed via apt.
  • OBS Studio - Screen recording and streaming. Installed via apt
  • OpenShot - Video Edition. Available as AppImage.

Audio

  • Audacity - Audio recording. Installed via apt.
  • Spotify - On-demand music, installed via snap.
  • LMMS - Music making (loops / midi etc). Available as AppImage.

3D Design & Printing

  • FreeCAD - 3D Design. Available as AppImage.
  • OpenScad - Programatic 3D Design. Installed via apt.
  • Blender - 3D Design and modeling. Available as tar file that you just need to unpack to your home folder.
  • Prusa Slicer - 3D Printing Software for Slicing Models. Available as AppImage.

You can download all the AppImages and then do the following:

mv ~/Downloads/*.AppImage ~/Apps
chmod +x ~/Apps/*.AppImage

UPDATE: Disabling Wayland on Ubuntu 21.04

updated on May 7

Yesterday I was just about to record some screencasts with OBS when I noticed there was something strange going on. The screen capture was coming all black, only the cursor would show up; not only that, but also the window capture was not working at all, not even listing the currently open windows.

I also tried Peek, another screen recording application, to the same results.

I've been tracking down the problem since yesterday and finally found the reason and the solution. Wayland, a new display server protocol, is now enabled by default to replace X11 on Ubuntu 21.04. I didn't know anything about this, but after some Googling I found out other people having similar issues with OBS on Ubuntu and finally I was able to fix it!

To disable Wayland on Ubuntu 21.04, go to your terminal and open the file /etc/gdm3/custom.conf using your command-line editor of choice:

sudo vim /etc/gdm3/custom.conf

Look for the line saying #WaylandEnable=false and uncomment it by removing the # character from the beginning of the line. Save and close the file - with vim, you can do that by typing ESC then wq and ENTER.

Then you just need to restart your window manager with:

sudo service gdm3 restart

You should now be all set!

Conclusion

Setting up a new system is a neverending task, but I am pretty happy now with the current state of my new laptop :) Can't wait to try out some of this software with this machine, since it's a big upgrade from my previous one.

Anything important I missed? Tell me in the comments (:

Current State