How to manage your Docker containers with DockStation – The New Stack
When looking for a graphical tool to manage your Docker containers, you’ll find more options than you might imagine. These tools range from the overly simplistic to the remarkably complicated, and everything in between. Every once in a while, though, you’ll find a desktop client that does a stellar job of making container management easier.
Such a graphical interface is Dock, which is available for Linux, macOS, and Windows and can be used for free for personal and startup use. With DockStation, you’ll find features like:
- Manage both services and containers
- Backwards compatibility
- Monitoring statistics, ports and logs
- Project creation
- Built-in analyzer
- Drag and drop images onto projects
- Docker Compose support
One of the only caveats to DockStation is that while it lets you create and manage projects on localhost (the machine the app is installed on), with remote hosts you can’t create. You can do a lot with your remotely connected Docker server though.
Let’s start by installing DockStation, build our first project on the local machine, then connect it to a remote machine. I will demonstrate on Pop!_OS Linux and connect to a remote Ubuntu Server instance with Docker installed.
How to install DockStation
Installing DockStation is quite simple. The first thing you need to do is download the installation file compatible with your operating system. As I am using a Debian based distro, I will download the .deb file from the DockStation download page. Save the file to your ~/Downloads directory, then open a terminal window.
From the terminal, install DockStation with the command:
sudo dpkg -i ~/Downloads/dockstation*.deb
If the installation error occurs, correct the problem with:
sudo apt-get install -f
Once the installation is complete, you are ready to launch the application.
Launching DockStation and connecting
Launch DockStation and in the login window (Figure 1), register with Google or GitHub or click Register Now and follow the instructions to create an account.
Upon successful authentication, an empty projects tab will be displayed (Figure 2).
Click + to create a new project. In the resulting window (picture 3), give the project a name, then set a path to host the project files and folders.
After filling in the required information, click CREATE to add the new project.
Let’s build a WordPress project. Type WordPress in the search file then, when the official image appears (Figure 4), drag it from the center column to the right.
Wait for the versions to populate, then from the dropdown select the image tagged with latest. Click OK and the image will be added. Then click on the gear icon associated with the image and you can modify the service to suit your needs perfectly (Figure 5).
Once the configuration is complete, click OK and you are returned to the project window. Click the start button associated with the WordPress service to deploy the container.
And that’s it for creating a very basic container deployment with DockStation on your local machine.
Connecting DockStation to a Remote Host
This part is a little tricky because it’s hidden in plain sight. We are going to use SSH as a way to connect to the remote machine. Before doing this, we need to generate an SSH key and copy it to our remote host.
To generate the SSH key, open a terminal window and run the command:
Go ahead and accept the defaults and when prompted, make sure to give the key a strong password.
Once the key is generated, you must copy it to the remote server with the command:
ssh-copy-id [email protected]
Where USER is the username on the remote server and SERVER is the IP address of the remote server.
With the copied key, you can now connect DockStation to the remote server. To do this, click the Containers tab and click the edit button directly to the left of localhost in the upper left corner (Figure 6).
In the resulting window (Picture 7), click ADD.
Click on the SSH tab in the resulting window and fill in the necessary information (Figure 8).
Click OK and, when prompted, enter the password for the SSH key you generated earlier. Now, in the localhost dropdown (top left corner), select the new connection you just created and click CONNECT. Again you will be prompted for your SSH key password. After successful authentication, you will see all containers running on your remote server (Picture 9).
There. Yet another Docker GUI you can use to manage your container deployments. I admit I’m a fan of DockStation, but I wish they allowed deploying to a remote server from the GUI. Even with that caveat, DockStation is still a great tool for container management.
The New Stack is a wholly owned subsidiary of Insight Partners, an investor in the following companies mentioned in this article: Docker.