DEV Community

Bee
Bee

Posted on

# Set Up My Dev Environment: Git, Docker, and GitHub SSH on Linux

Hi everyone! 👋

I recently set up my development environment and thought I’d share how I installed Git, Docker, and configured Git with GitHub SSH on my machine. If you’re getting started with development or just want a clean setup, this guide might help you too!


🔧 1. Installing Git

Git is essential for version control, so it was my first step.

🖥️ Commands I Used:

sudo apt update
sudo apt install git
Enter fullscreen mode Exit fullscreen mode


`

✅ Verifying Git Installation:

bash
git --version

If installed correctly, this returns something like:


git version 2.xx.x


🐳 2. Installing Docker

Next up was Docker — a tool I’ll be using to containerize apps and run environments in isolated containers.

Steps I Followed:

  1. Removed old Docker versions (just in case):

bash
sudo apt remove docker docker-engine docker.io containerd runc

  1. Installed dependencies:

bash
sudo apt update
sudo apt install ca-certificates curl gnupg

  1. Added Docker’s GPG key:

bash
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | \
sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg

  1. Added the Docker repository:

bash
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] \
https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

  1. Installed Docker Engine:

bash
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

  1. Verified Docker Installation:

bash
docker --version

This gave me something like:


Docker version XX.XX.X, build XXXXX

  1. (Optional) To use Docker without typing sudo every time:

bash
sudo usermod -aG docker $USER
newgrp docker


🔐 3. Configuring Git with GitHub via SSH

To avoid typing my GitHub credentials every time I push changes, I set up Git to authenticate using SSH.

🧑‍💻 Steps I Took:

  1. Generated a new SSH key:

bash
ssh-keygen -t ed25519 -C "myemail@example.com"

I accepted the default file location and passphrase.

  1. Added the SSH key to the agent:

bash
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519

  1. Copied my SSH key:

bash
cat ~/.ssh/id_ed25519.pub

  1. Added the key to GitHub:
  • Went to GitHub > Settings > SSH and GPG keys
  • Clicked “New SSH Key”
  • Pasted the key and saved
  1. Tested the SSH connection:

bash
ssh -T git@github.com

It responded with:


Hi your-username! You've successfully authenticated...

  1. Set up Git username and email globally:

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


✅ Final Thoughts

Now my environment is ready for development with:

  • 📁 Git for version control
  • 🐳 Docker for containerization
  • 🔐 GitHub SSH for secure, password-free pushing and pulling

This setup will help me manage projects more efficiently and collaborate more smoothly. If you're setting up yours too and get stuck—feel free to drop a question!

Top comments (0)