⚙️ Sample Document: How to Set Up Your Environment¶
Depending on your operating system, please follow all the steps presented for your specific system:
Windows¶
Installing Ubuntu within WSL 2 on Windows¶
Windows Subsystem for Linux (WSL) allows you to run a full Linux environment without the need for a virtual machine. Below is the guide on how to install Ubuntu on WSL 2.
Step 1: Check System Compatibility¶
WSL 2 is available on Windows 10, version 1903 and newer, as well as Windows 11. Before starting, ensure your system meets these requirements.
Step 2: Enable WSL¶
-
Open PowerShell as Administrator:
- Right-click on the "Start" button and select "Windows PowerShell (Administrator)" or "Windows Terminal (Administrator)".
-
Enter the following command to enable WSL:
-
Now, enable the WSL 2 feature by typing:
-
Restart your computer to apply the changes.
Step 3: Set WSL 2 as the Default Version¶
- Re-open PowerShell as Administrator.
- Set WSL 2 as the default version by typing:
Step 4: Install Ubuntu¶
- Open the Microsoft Store on your computer.
- In the search box, type "Ubuntu" and select one of the available versions (e.g., Ubuntu 22.04 LTS).
- Click “Install”.
Step 5: Configure Ubuntu¶
- After installation, click “Launch”.
- A console will appear to complete the installation. This may take a few moments.
- Set your username and password to be used within Ubuntu.
Step 6: Update the System¶
- Launch Ubuntu from the Start menu.
- Update packages by entering the following in the terminal:
Congratulations! You have successfully installed and configured Ubuntu within WSL 2 on your Windows computer.
Installing Git in WSL (Windows Subsystem for Linux)¶
The following instructions show how to install Git on Ubuntu distribution within WSL.
Step 1: Launch Ubuntu¶
- Open the Start menu on your computer.
- Search for
Ubuntu
and click to open the Ubuntu terminal.
Step 2: Update Package Lists¶
Before installing new packages, ensure that the list of available packages is up to date.
Step 3: Install Git¶
After updating the package list, execute the command to install Git.
Step 4: Verify Installation¶
To ensure Git is correctly installed, check its version using the command:
If Git is installed correctly, you should see the installed version information, such as git version 2.25.1
.
Step 5: Configure Git¶
After installation, set your user information to be used in commit metadata.
-
Set your username (replace Your Name with your actual name):
-
Set your email address (replace youremail@example.com with your assigned email address):
Congratulations! Git is now installed and configured in your WSL environment with Ubuntu.
Installing Docker CE on WSL 2 (Windows Subsystem for Linux 2)¶
Below are detailed instructions for installing Docker CE on Ubuntu within WSL 2 under Windows.
1. Launch Ubuntu¶
Start by launching Ubuntu from the Start menu in Windows.
2. Update and Prepare the System¶
In the Ubuntu terminal, enter the following commands to update the system and install necessary packages:
sudo apt update && sudo apt upgrade
sudo apt install --no-install-recommends apt-transport-https ca-certificates curl gnupg2
3. Configure iptables
¶
Configure iptables
by entering:
4. Add Docker GPG Key and Repository¶
Add Docker's GPG key and repository by executing:
. /etc/os-release
curl -fsSL https://download.docker.com/linux/${ID}/gpg | sudo tee /etc/apt/trusted.gpg.d/docker.asc
echo "deb [arch=amd64] https://download.docker.com/linux/${ID} ${VERSION_CODENAME} stable" | sudo tee /etc/apt/sources.list.d/docker.list
sudo apt update
5. Install Docker CE¶
Now install Docker CE and its components:
6. Add User to Docker Group¶
To access Docker without administrative privileges, add your user to the "docker" group:
7. Restart the WSL Environment¶
To apply changes, restart WSL:
- Close all WSL terminal windows.
- Restart the WSL terminal, logging into your account.
After these steps, Docker CE should be properly installed and ready to use in the WSL 2 environment. You can verify this by entering in the terminal:
Linux/macOS¶
Instructions to Install Git on Linux¶
Step 1: Open Terminal¶
Open the terminal on your Linux system. You can do this by using the Terminal application in the app menu or using a keyboard shortcut (e.g., Ctrl
+ Alt
+ T
for Ubuntu).
Step 2: Update Package Lists¶
Before installing new software, it’s advisable to update the list of available packages. Enter the following command and press Enter
:
Step 3: Install Git¶
Now we can install Git. Enter the following command and press Enter
:
Step 4: Confirm Installation¶
During installation, you may need to confirm. Press Y
and Enter
to continue when prompted.
Step 5: Check Git Version¶
After installation, you can check if Git was installed correctly by typing:
You should see the installed version of Git, such as: git version 2.34.1
.
Step 6: Configure Git¶
Finally, it’s useful to configure basic user settings for Git. Use the following commands to set your name and email (remember to replace Name and Surname with your name and your email with your business email):
That's it! You have installed and configured Git on your Linux system.
Installing Docker CE on Linux¶
-
Open Terminal
Open the terminal on your Linux system to begin the Docker installation.
-
Update Package Lists and Install Available Updates
-
Install Required Packages
For Docker to be installed correctly, you need a few additional packages:
-
Add Docker's GPG Key
Download and add Docker's official GPG key:
-
Add Docker CE Repository
Add Docker's official repository to APT:
-
Install Docker CE
After adding the repository, install Docker CE and additional components:
-
Enable and Start Docker Service
Ensure Docker is enabled and running:
-
Add User to Docker Group
To run Docker commands without using
sudo
, add your user to the Docker group: -
Finish
Log out and log back in for changes regarding user group membership to take effect.
Done! Your Docker CE should now be installed and ready to use on your Linux system.