After setting up a custom Docker registry on Nexus OSS, you might want to connect your Docker client to it. It is very easy to do so — let me explain how.
Step 1 – Obtain your repository URL
Find the URL of your Nexus Docker registry. In our example it is:
http://192.168.0.10:8181
(Yes, I know — it is not running on HTTPS. More on that below.)
Step 2 – Edit the Docker daemon configuration
Open (or create) /etc/docker/daemon.json and add the following:
{
"insecure-registries": ["http://192.168.0.10:8181"],
"registry-mirrors": ["http://192.168.0.10:8181"]
}
Why insecure-registries?
Because this connector is running over plain HTTP, Docker refuses to use it by default. Adding it to insecure-registries tells Docker it is safe to connect without TLS. If your Nexus repository is behind HTTPS you can omit that key entirely.
Why registry-mirrors?
This instructs Docker to pull images from your Nexus registry first. If the image is not found there, Docker falls back to Docker Hub. This is great for caching frequently used images and reducing external bandwidth.
Step 3 – Restart the Docker daemon
Apply the configuration change:
sudo systemctl restart docker
Step 4 – Pull an image
Try pulling any image — Docker will now fetch it from your own Nexus repository:
docker pull nginx
If the image is already cached in Nexus you will see it downloaded at local network speed. Otherwise it is fetched from Docker Hub and stored in Nexus for future pulls.
That is all there is to it. Your Docker client is now connected to your self-hosted Nexus OSS registry.