My Fedora 40 Development Setup

Learn how to install Copilot CLI, Node.js, Node.js, Visual Studio Code, development packages, and Docker with step-by-step CLI commands

My Fedora 40 Development Setup
Credit: Fedora 40 Official Wallpaper

Copilot CLI

We need to install GitHub CLI first. I would like to install it from Github’s package repository for immediate access to the latest releases:

sudo dnf install 'dnf-command(config-manager)'
sudo dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo
sudo dnf install gh

Now, we can install Copilot in the CLI. First, we need to authenticate our Github account:

gh auth login

After authenticating our account, we need to install copilot as a Github CLI extension:

gh extension install github/gh-copilot

If you see a successful installation message, then we are all set. If you would like to upgrade Copilot CLI, here is the command:

gh extension upgrade gh-copilot

The Copilot CLI extension’s command is a bit long so that we can use the power of aliases in Linux. If you followed my My Fedora (Gnome) Setup article,

you are already using zsh as your shell. So here is the command to shorten commands:

echo 'eval "$(gh copilot alias -- zsh)"' >> ~/.zshrc

But there is a catch! When this command runs, it adds eval "$(gh copilot alias -- zsh)" to ~/.zshrc file, but then, you may not have the terminal loaded properly (at least, it happened to me). It is because of a data collection question. If you have the same problem, cancel the operation with Ctrl + C the keyboard shortcut and then run this command directly inside the terminal: gh copilot alias -- zsh . You need to answer the data collection question, and then you are good to go. You won't have an unresponsive terminal further.

At the end, you can try it:

ghcs 'print "Hello world!"'

Node.js Installation

Although I am not a NodeJS developer, sometimes I need to do simple things or some packages require to use it. I will install it very simply and stick to Fedora repository versioning.

sudo dnf install nodejs

After the installation (which also comes with the npm package manager), you can check the versions from the terminal.

node -v
npm -v

Visual Studio Code

Although it is eligible to be installed with Flatpak, I would like to install it with dnf because I would like to reach to system-wide packages too.

First, let’s add the repo:

sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo'

Time to install:

sudo dnf check-update
sudo dnf install code

Necessary Development Packages

sudo dnf install @development-tools
sudo dnf group install "C Development Tools and Libraries"

Docker Engine

Docker Desktop is a bit problematic to install and maintain for the new versions, so I don’t prefer a GUI for Docker in Linux. It is not mandatory, and the command line is more than enough to manage Docker images.

sudo dnf install dnf-plugins-core
sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo
sudo dnf install docker-ce docker-ce-cli containerd.io

To start the Docker service:

sudo systemctl start docker

If you would like to have Docker start when the system reboots:

sudo systemctl enable docker

Why do we need sudo right for Docker in Linux? Here is a good document: https://projectatomic.io/blog/2015/08/why-we-dont-let-non-root-users-run-docker-in-centos-fedora-or-rhel/

Or you can follow the adding group method here (I am using this version): https://docs.docker.com/engine/install/linux-postinstall/

Docker Compose

You should have docker before installing docker-compose. Then:

sudo dnf install docker-compose

You can check one of the docker-compose files here: https://github.com/canartuc/docker_compose_files


If you missed:

Subscribe to Can Artuc

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.
jamie@example.com
Subscribe