Docker & MySQL Workbench
Tools ⭔ Installation guide
Introduction
First we will have a one day workshop about Docker. Afterwards, for the rest of the week we
will learn and practice MySQL databases.
To prepare, we need to install some tools:
● “Docker” / “Docker Desktop” for the workshop we have on Monday
● “MySQL Workbench” for the rest of the week (Please note that we will only install
MySQL Workbench, not the MySQL Server or anything else)
Please read the instructions below before you start installing the tools.
This document is quite long so you might want to use the document outline sidebar to the
left to navigate.
Docker
Installation on Ubuntu/Debian
(SOURCE)
This was only tested on Pop!_OS, but should work similarly on Ubuntu and other
Debian-based distros. Everything happens inside the terminal, so you should know how to
use it.
1. Firstly, uninstall any old versions of Docker. This should normally not be necessary,
but just in case run the following command in your terminal:
sudo apt-get remove -y docker docker-engine [Link]
containerd runc
It’s fine if APT reports that none of these packages are installed. If you want to do a
fully clean install, look here.
2. Next, as always before installing any packages, run an update of the index:
sudo apt update
Then, install some required packages needed for the installation:
sudo apt-get install -y ca-certificates curl gnupg lsb-release
As before, these should already be installed, but just in case.
3. Next, we have to add Docker’s GPG key so we can verify the packages. Just run this
whole command (copy/paste it all at once):
sudo mkdir -m 0755 -p /etc/apt/keyrings && curl -fsSL
[Link] | sudo gpg
--dearmor -o /etc/apt/keyrings/[Link]
This will download the GPG key of Docker, decode it, and write it into the APT keyrings
folder. There’s no output.
4. Next, we’ll add the Docker repository source for APT. Just run this whole command
(copy/paste it all at once):
echo "deb [arch=$(dpkg --print-architecture)
signed-by=/etc/apt/keyrings/[Link]]
[Link] $(lsb_release -cs)
stable" | sudo tee /etc/apt/[Link].d/[Link] >
/dev/null
This will just create a file with the repository definition in our APT sources folder.
There’s no output.
5. This was the complicated part. Now we just update the package index again:
sudo apt update
And then install all the required Docker packages:
sudo apt-get -y install docker-ce docker-ce-cli [Link]
docker-buildx-plugin docker-compose-plugin
This might take a while. Just so you know this command will also install the buildx
and docker-compose plugins, which might not be needed in this course, but are
very useful nonetheless.
6. There is one last problem: running Docker commands requires root permissions
every time (aka. you have to use “sudo”).
You can leave this if you want to use "sudo" every time, otherwise run the following
command:
sudo groupadd docker && sudo usermod -aG docker $USER
This will create a user group called “docker” (which might already exist) and add
your user to it, which gives you all the privileges needed and you can use the
Docker CLI without “sudo”.
7. Before you can finally start using Docker, you should create a Docker Hub account
and login to your account in the terminal.
Just go to your account security settings, create a new access token, and then
follow the on-screen instructions for logging in (there should be a command like
docker login -u <username>).
8. Now you should restart your PC.
To test if the installation was successful, you can run the following command
afterwards:
docker run --rm hello-world
This will download the “hello-world” image, start a container using the image, write
something to the terminal, and immediately exit and remove the container again.
So basically you’ve started your first container! Congrats!
Installation on Windows 10 / 11 (? hopefully the same)
(SOURCE 1, SOURCE 2)
This was only tested on Windows 10 (Version 22H2), but should work similarly in Windows 11.
You will need to use a command prompt for the installation, so you should be familiar with
it.
1. First we need to install Windows Subsystem for Linux v2 (WSL 2), since Docker uses
this as its backend for virtualization. Previously it relied on Hyper-V, which only the
Pro versions of Windows came with, but we don’t need to worry about that
anymore.
Before you can install WSL 2 though, you have to make sure that hardware
virtualization is enabled in your BIOS, which should be the default on most laptops
anyway.
Just check that “Virtualization” says “Enabled” in your Task Manager, as seen below.
If that’s not the case, please check with your hardware manufacturer how to enable
it in the BIOS.
2. Now, to install WSL 2, all you have to do is open a command prompt (preferably
PowerShell) and run the following command:
wsl --install
This should be all that’s needed to install WSL 2. On older versions of Windows 10 you
had to take some different steps, but thankfully it’s much easier now with the CLI.
If you see any error messages after running the command above, please let us
know.
3. After installing WSL 2, you should restart your PC, as suggested by the installer itself.
And after the restart, it will continue with finishing the WSL 2 installation by setting up
the default distro: Ubuntu. We don’t really need it so you could close the command
prompt window if you want. But if you have experience with Ubuntu and would like
to have a Ubuntu subsystem, you can go through the installation steps (setting up
a user, password, etc.).
4. Next, we will install Docker Desktop, which is actually a GUI for Docker, but it includes
the Docker Engine/CLI and is much simpler to set up than the alternatives.
To install Docker Desktop, just download the installer by clicking on the following link:
[Link]
After the download is finished, just run the installer and go through the installation
steps. You can leave everything on the default options. It might take a while to
install and then ask you to logout and login again to finish the installation.
5. That’s pretty much it. It's possible that a “Subscriber Agreement” pops up when you
start Docker Desktop for the first time. Just accept it and you should be good to go.
Also it might ask you some questions and offer a tutorial, proceed however you
want.
To use Docker you will always need to have Docker Desktop running in the
background. You can close the Docker Desktop window but make sure the Docker
icon still appears in the tray area in the taskbar. To fully quit Docker Desktop you
need to right-click the tray icon and select “Quit” (similar to Slack and other
“background apps”).
6. Before you can finally start using Docker, you should create a Docker Hub account
and login to your account in the Docker Desktop app. The “Sign in” button is on the
top-right corner.
7. To test if the installation was successful you can run the following command in your
command prompt, after starting Docker Desktop:
docker run --rm hello-world
This will download the “hello-world” image, start a container using the image, write
something to the terminal, and immediately exit and remove the container again.
So basically you’ve started your first container! Congrats!
Installation on macOS
(SOURCE)
This was only tested on macOS Ventura 13.2, but should work similarly for all other versions
of macOS.
The installation process on macOS is probably the most straightforward one.
1. FIrstly, please check whether you have an Apple chip or an older Intel chip, by
clicking on the Apple logo in the left corner of the menu bar, and then going to
“About this Mac”. If the “Chip” section contains something like “Apple M1”/”Apple M1
Pro” or “Apple M2”/”Apple M2 Pro”, then you have an Apple chip, as seen below.
2. Once you’ve confirmed your chip manufacturer, just download the Docker Desktop
installer by clicking on one of the two following links:
- For Apple chips: [Link]
- For Intel chips: [Link]
After the download is finished, just run the installer and drag the Docker icon into
the “Applications” folder, which is all that’s required to install it. This will be very
straightforward if you’ve ever installed an app on your Mac.
3. That’s pretty much it. It's possible that a “Subscriber Agreement” pops up when you
start Docker Desktop for the first time. Just accept it and you should be good to go.
Also it might ask you some questions and offer a tutorial, proceed however you
want.
To use Docker you will always need to have Docker Desktop running in the
background. You can close the Docker Desktop window but make sure the Docker
icon still appears in the menu bar above. To fully quit Docker Desktop you need to
right-click the menu bar icon and select “Quit” (similar to Slack and other
“background apps”).
4. Before you can finally start using Docker, you should create a Docker Hub account
and login to your account in the Docker Desktop app. The “Sign in” button is on the
top-right corner.
5. To test if the installation was successful you can run the following command in your
terminal after starting Docker Desktop:
docker run --rm hello-world
This will download the “hello-world” image, start a container using the image, write
something to the terminal, and immediately exit and remove the container again.
So basically you’ve started your first container! Congrats!
MySQL Workbench
Installation on Ubuntu/Debian
(SOURCE 1, SOURCE 2)
This was only tested on Pop!_OS, but should work similarly on Ubuntu and other
Debian-based distros. Everything happens inside the terminal, so you should know how to
use it.
This is very similar to the Docker installation process.
1. (This step can be skipped if you already went through the Docker installation)
Firstly, as always before installing any packages, run an update of the index:
sudo apt update
Then, install some required packages needed for the installation:
sudo apt-get install -y ca-certificates curl gnupg lsb-release
These should already be installed, but just in case.
2. Next, we have to add MySQL’s GPG key so we can verify the packages. Just run this
whole command (copy/paste it all at once):
sudo mkdir -m 0755 -p /etc/apt/keyrings && curl -fsSL
[Link] | sudo gpg
--dearmor -o /etc/apt/keyrings/[Link]
This will download the GPG key of MySQL, decode it, and write it into the APT keyrings
folder. There’s no output.
3. Next, we’ll add the MySQL repository source for APT. Just run this whole command
(copy/paste it all at once):
echo "deb [arch=$(dpkg --print-architecture)
signed-by=/etc/apt/keyrings/[Link]]
[Link] $(lsb_release -cs)
mysql-tools" | sudo tee /etc/apt/[Link].d/[Link] >
/dev/null
This will just create a file with the repository definition in our APT sources folder.
There’s no output.
4. This was the complicated part. Now we just update the package index again:
sudo apt update
And then install the MySQL Workbench package:
sudo apt-get -y install mysql-workbench-community
This might take a while.
5. That should be all. Now the MySQL Workbench app should appear in your
applications menu and you can start using it. On some Linux distros, like Pop!_OS,
you might get a pop-up saying that your OS isn’t supported, but you can probably
safely ignore this.
Installation on Windows 10
(SOURCE)
Installing MySQL Workbench on Windows 10 is very straightforward.
This was only tested on Windows 10 (Version 22H2), but should work similarly in Windows 11.
1. To install MySQL Workbench, just go to the following page, select “Microsoft
Windows” and then click on the download button in the “Other Downloads” section:
[Link]
Do NOT download the MySQL Installer! This will install some other components that
we don’t want. Only download the MySQL Workbench installer at the bottom.
You will probably get redirected to a page where they ask for your login credentials,
but just select “No thanks, just start my download” at the bottom and the download
should start..
2. After the download is finished, just run the installer and go through the setup. Make
sure to select the “Complete” setup type, when asked, so you get all features.
The rest should be relatively straightforward if you’ve ever installed a program on
Windows.
If you have a freshly installed Windows PC, you might get an error message that you
need to install Visual C++ Redistributable for Visual Studio 2019 first, which you can
download by clicking on this permalink:
[Link]
Just download the Visual C++ installer and run it. The installation process is also
very straightforward. Once Visual C++ is installed, you can continue with the MySQL
Workbench installation.
3. That should be all. Now you can just start the app and use it!
Installation on macOS
(SOURCE)
This was only tested on macOS Ventura 13.2, but should work similarly for all other versions
of macOS.
Installing MySQL Workbench on macOS is very straightforward.
1. To install MySQL Workbench, just go to the following page, select “macOS” and then
click on the download button below: [Link]
You will probably get redirected to a page where they ask for your login credentials,
but just select “No thanks, just start my download” at the bottom and the download
should start..
2. After the download is finished, just run the installer and drag the MySQL Workbench
icon into the “Applications” folder, which is all that’s required to install it. This will be
very straightforward if you’ve ever installed an app on your Mac.
3. This should be it. Now you can just start the app and use it!