Making the Switch to Linux for Development: A Developer's Experience

Published: October 24, 2023

Linux continues to be a popular choice among developers, ranking as the 2nd most commonly used operating system for coding in the Stack Overflow Developer Survey of 2022. In this post, I'll share why I switched from Windows to Linux for development and how I set up my system for various tasks, including web development, machine learning, etc.

Ubuntu Desktop

Why Linux?

So why did i make the switch from Windows to Linux? Well, apart from a lot of people raving on about how Linux was superioir for development, I was also curious about some other features:

  1. Built-in Package Managers: Quickly install what you need without searching for installers.
  2. Ease of Access & Installation: Documentation and guides are easier to follow.
  3. Web Development: For web-dev, I'll now be coding out in the same OS as i have on the Server. The way I set out the env or interact with the system is the same way it will be deployed, so the errors i encounter should in theory be more familiar to me after a while?
  4. Native Docker Support: So it is faster.
  5. Better Command Line Utilities: No need for additional shells like Git Bash.
  6. SSH Support: Access servers without additional installations.
  7. Free: No cost to use.
  8. Customization: Choose from different distributions and customize your desktop. In terms of Distros, I tried 3 (PopOS, Fedora and then Ubuntu), and the choice and flexibility of catering your OS to your own needs and styles is a really intersting change.
  9. Flexibility: Adapt the OS for your specific needs, like docks, Icons, themes, you name it.

Work Environment

I was afraid that I would mess things up, so I decided to capture the most important aspects of my distro for anyone interested in using Linux as their primary OS for development. If you are a developer and just installed PopOS/Fedora/Ubuntu on your system, then you are probably facing a long post-install process to setup your computer for your development use. I had to go through that 3 times in the last week when I was getting used to differnt distro's, so I made a note of what I wanted to remember to set up each time, so I thought I'd share how I set up my personal workstation.

The most important, of course, is the operating system. I'm running Ubuntu 23.10 Mantic Minotaur at the moment with GNOME 45 as the Desktop, and I'm very happy with it. I find Ubuntu more suitable for development machines than other distros, and its pretty! I use it for a variety of tasks, including TypeScript, Python, AI, running Docker containers, cloud deployments, and even blogging.

Setting Up a New Linux System for Development

Essential Tools

In terms of development tools, it is mostly objective choices and really don't matter as long as you are comfortable with the tools you choose. Below are my choices for some of the processes / important categories for development.

  1. Run Updates:
    • sudo apt-get update
    • Restart ofc
  2. NVIDIA Drivers: Install via Gnome Software.
  3. IDE & Code Editors: I use VS Code & PyCharm.
    • I use VS Code & PyCharm as my go-to editors. I love it. I use VSCode for web development in JS and TS, and i use PyCharm for AI, Data Science and Python in general.
    • VSCode: window.titlebarstyle should be set to custom to prevent the default linux title bar
    • Also in VSCode, set editor.selectionClipboard to false to prevent the default paste selection on middle mouse click on Linux
  4. Python Versions: Install the versions you need for your projects.
    • The deadsnakes PPA is only available for LTS versions of Ubuntu, and 23.04 Mantic Minotaur is not an LTS version. So, you can't use the deadsnakes PPA to install alternate versions of Python.
    • Instead, compile & install python from source
    • Important to note to use sudo make altinstall instead of sudo make install to prevent overwriting the default python version.
    • Add the Python Interpreters to PyCharm.
Python Interpreter Versions
  1. SSH Key for GitHub:
    • sudo apt-get install git
    • git --version
    • git config --global user.name "shavvimal" && git config --global user.email "shavhugan@gmail.com"
    • ssh-keygen
    • To view the generated SSH Key, run cat ~/.ssh/id_rsa.pub
    • Add to the GitHub SSH keys settings page in your browser and click 'New SSH Key'
  2. Node & NPM:
    • Runsudo dnf install nodejs or sudo apt install nodejs and sudo apt install npm
    • This will install V8 Javascript Engine, Node.js runtime and npm package manager and their dependencies. Versions present in repositories are usually current Node.js LTS releases, including npm and V8 engine that come with them.
  3. NVM (Node Version Manager): Manage multiple Node.js versions.
    • is a bash script to manage multiple Node.js versions. nvm makes it easier to install, uninstall, and switch between different versions. Visit it’s Github page to follow the latest installation instructions. nvm is a great tool that lets us switch between node versions. This can be extremely useful when working with others.
    • To download, compile, and install the latest release of node, do this: nvm install node # "node" is an alias for the latest version
    • To install a specific version of node: nvm install 14.7.0 # or 16.3.0, 12.22.1, etc
    • The first version installed becomes the default. New shells will start with the default version of node (e.g., nvm alias default).
    • You can list available versions using nvm ls-remote:
    • And then in any new shell just use the installed version nvm use node
  4. Docker or Docker Alternative: Consider using Podman
  5. Install Go: Use tar to extract the tarball from the Go site.
    • Use a command like sudo tar -C /usr/bin -xvf go1.21.4.linux-amd64.tar.gz. This command includes the -C flag which instructs tar to change to the given directory before performing any other operations. This means that the extracted files will be written to the /usr/bin/ directory. The x flag tells tar to extract, v tells it we want verbose output, and f tells it we’ll specify a filename
    • Set paths in the environment i.e. set Go’s root value, which tells Go where to look for its files. You can do this by editing the .profile file, which contains a list of commands that the system runs every time you log in. To edit the file, sudo nano ~/.profile, then, add export PATH=$PATH:/usr/bin/go/bin.
    • Refresh profile with source ~/.profile
  6. Install D2 executable with go install oss.terrastruct.com/d2@latest
    • Ensure it is on your system PATH

UI/User Experience

Once that is all there, I then edited the UI/User Experience:

  1. Extensions: Use Gnome Tweaks for customization.
    • A lot of things are hidden by default, such as Maximise, Minimize, Appearance Tweaks like Icons etc.
  2. Fonts & DPI: Adjust as needed.
  3. VPN: I use Surfshark VPN.
    • Change DNS servers to Google
    • Download the Surfshark OpenVPN configurations
    • Set up OpenVPN in the Settings UI
    • use nm-connection-manager to automatically start the VPN connection on WiFi Connection
  4. Icons & Themes: I use the WhiteSur Icon Pack. I also use McMojave Cursors
    • The new App Center on 23.10 installs snaps. The snap's .desktop file is located at:
/var/lib/snapd/desktop/applications/snap-name_application-name.desktop
  • Note the location: It will be overwritten every time the snap updates. You cannot prevent it. So DON'T bother editing this file.
  • Copy the .desktop file to:
~/.local/share/applications/snap-name_application-name.desktop
  • The name schema (snap-name_application-name) is critical. Don't change it.
  • Edit this copy with the new icons
  • Using the WhiteSur Icon Pack. Icons can be found at:
/home/shav/.local/share/icons/WhiteSur-dark/apps/scalable
  • Within the folder, to search for an app, you can run ls | grep chrome for example
  1. Key Mappings
    • SHortcut for the terminal, i.e. perform flatpaak run com.raggesilver.BlackBox on shift + ctrl '
  2. Add other apps that I use:
    • Brave Browser
    • Discord
    • Whatsapp
    • Office suite: I mostly use Google Docs & Microsoft office online, but when I have to work on something on my Desktop I use LibreOffice which is a good office suite and even handles Microsoft Office & Keynote formats.
    • Blackbox Terminal
    • Spotify etc.
  3. Other qulaity of life changes:
    • Add Bookmarks with ctrl + D to the File Viewer

Useful Shortcuts and Aliases

In my .bashrc:

alias docker="podman"
alias grm="git rebase master"
alias grc="git rebase --continue"
alias gra="git rebase --abort"
alias grs="git rebase --skip"
alias gpo="git push origin"
alias gs="git stash"
alias gsa="git stash apply"
alias dps="docker ps"
alias dk="docker kill"
alias dpsa="docker ps -a"
alias dipa="dipa"
alias drm="docker rm"
alias cl="clear"
alias fopen="xdg-open ."
alias gacp='f(){ git add . && git commit -m "$1" && git push; }; f'
alias charm="sh /opt/pycharm-2023.2.2/bin/pycharm.sh"
 
function mkcd {
  command mkdir $1 && cd $1
}
 
function dipa(){
  docker rm -v $(docker ps -a -q -f status=exited);
  docker volume rm $(docker volume ls -qf dangling=true);
  docker rmi $(docker images -qf dangling=true);
}

Mastering the PATH

The PATH is an important concept when working on the command line. It's a list of directories that tell your operating system where to look for programs, so that you can just write script instead of /home/me/bin/script or C:\Users\Me\bin\script. But Linux has a different way of adding a new directory to it than Windows does:

Setting PATH in Windows

When I was using windows, this was the procedure:

  1. Accessing System Settings:
    • Windows 8/10: Press the Windows key, search for "System (Control Panel)", and select it.
    • Windows 7: Right-click the "Computer" icon on the desktop and click "Properties".
  2. Advanced System Settings: Click on "Advanced system settings".
  3. Environment Variables: Select "Environment Variables".
  4. Editing PATH:
    • Locate PATH under "System Variables", select it, and click "Edit". If PATH is not listed, click "New".
    • Prepend your directory path followed by a semicolon (;). For instance, change C:\Windows\System32 to C:\Users\Me\bin;C:\Windows\System32.
  5. Save and Restart: Click "OK", then restart your terminal to apply the changes.

Setting PATH in Linux

  1. Editing .bashrc: Open .bashrc in your home directory (e.g., /home/your-user-name/.bashrc) in a text editor.
  2. Add PATH: Add export PATH="your-dir:$PATH" to the file's last line, customizing your-dir as needed.
  3. Save and Restart: Save the .bashrc file and restart your terminal.

Final Thoughts

Switching to Linux is supposed to make my development workflow more efficient, although I am new here, and I want to give it a proper go before i make any concrete conclusions. Yes there were hassles with set-up, GPU Drivers, etc. but I am excited to give this a go. If you're considering making the move, I hope this guide helps you set up your Linux system for development aswell.