Once Docker-ce and Docker-compose is installed, you can change the service parameters to expose Docker on a public port.
nano /lib/systemd/system/docker.service
Find the following line
ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
Replace it with the following
ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:4243 -H unix:///var/run/docker.sock
Save and close the file and then reload the systemd daemon to apply the changes
systemctl daemon-reload
Restart the Docker service
service docker restart
You can now validate the API using the following command
curl http://localhost:4243/version
You should get an output similar to the following
{"Platform":{"Name":"Docker Engine - Community"},"Components":[{"Name":"Engine","Version":"20.10.21","Details":{"ApiVersion":"1.41","Arch":"amd64","BuildTime":"2022-10-25T18:00:04.000000000+00:00","Experimental":"false","GitCommit":"3056208","GoVersion":"go1.18.7","KernelVersion":"5.4.0-132-generic","MinAPIVersion":"1.12","Os":"linux"}},{"Name":"containerd","Version":"1.6.10","Details":{"GitCommit":"770bd0108c32f3fb5c73ae1264f7e503fe7b2661"}},{"Name":"runc","Version":"1.1.4","Details":{"GitCommit":"v1.1.4-0-g5fd4c4d"}},{"Name":"docker-init","Version":"0.19.0","Details":{"GitCommit":"de40ad0"}}],"Version":"20.10.21","ApiVersion":"1.41","MinAPIVersion":"1.12","GitCommit":"3056208","GoVersion":"go1.18.7","Os":"linux","Arch":"amd64","KernelVersion":"5.4.0-132-generic","BuildTime":"2022-10-25T18:00:04.000000000+00:00"}