DEV Community

jgngo
jgngo

Posted on

8 3

Install Docker Community in WSL 2 (Ubuntu 22.04)

After installing Ubuntu 22.04 stable in WSL, I proceeded to install Docker Engine using the official Docker instructions. Since this is WSL, running sudo systemctl start docker does not work. To start the docker service, you'll need to use sudo /etc/init.d/docker start.

You will notice that the docker service is not running if you check using sudo /etc/init.d/docker status. The reason is because of this error in starting docker.

To fix this, you will need to update your default iptables to the legacy option. After doing this, you should be able to start the docker service and run the normal docker commands.

$ sudo update-alternatives --config iptables

There are 2 choices for the alternative iptables (providing /usr/sbin/iptables).

  Selection    Path                       Priority   Status
------------------------------------------------------------
* 0            /usr/sbin/iptables-nft      20        auto mode
  1            /usr/sbin/iptables-legacy   10        manual mode
  2            /usr/sbin/iptables-nft      20        manual mode
Enter fullscreen mode Exit fullscreen mode

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more →

Top comments (0)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More