{"id":257,"date":"2022-07-31T12:09:48","date_gmt":"2022-07-31T12:09:48","guid":{"rendered":"https:\/\/www.webhi.com\/how-to\/?p=257"},"modified":"2023-12-07T16:10:07","modified_gmt":"2023-12-07T16:10:07","slug":"how-to-install-and-use-docker-on-ubuntu-lts","status":"publish","type":"post","link":"https:\/\/www.webhi.com\/how-to\/how-to-install-and-use-docker-on-ubuntu-lts\/","title":{"rendered":"How To Install and Use Docker on Ubuntu 20.04\/22.04 LTS"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1200\" height=\"675\" src=\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/docker_ubuntu_en.jpg\" alt=\"Install and Use Docker on Ubuntu 20.04\/22.04 lts\" class=\"wp-image-1754\" srcset=\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/docker_ubuntu_en.jpg 1200w, https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/docker_ubuntu_en-300x169.jpg 300w, https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/docker_ubuntu_en-1024x576.jpg 1024w, https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/docker_ubuntu_en-768x432.jpg 768w, https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/docker_ubuntu_en-150x84.jpg 150w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Introduction<\/h2>\n\n\n\n<p>Docker, as a programme, simplifies the administration of application processes in containers, allowing you to execute your apps in resource-isolated processes. Containers are comparable to virtual machines, except they are more portable, resource-friendly, and dependent on the host operating system.<\/p>\n\n\n\n<p>This article will walk you through installing and configuring Docker Community Edition (CE) on Ubuntu 20.04 and 22.04 LTS. You will first install Docker, then handle containers and images before storing an image in a Docker Repository.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Prerequisites<\/h3>\n\n\n\n<p>You will need the following things to follow this guide:<\/p>\n\n\n\n<ul>\n<li>Set up one Ubuntu 20.04 or 22.04 LTS server.<\/li>\n\n\n\n<li>Have an account on Docker Hub if you prefer to make images on your own and push them to Docker Hub, as you\u2019ll see in Steps 7 and 8 of this guide.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Step 1: Install Docker<\/h2>\n\n\n\n<p>The Docker installation package offered in the official Ubuntu repository is unlikely to be the most recent version. To ensure that we obtain it, we&#8217;ll install Docker from the official Docker repository. We&#8217;ll be introducing a new package source for this, so install the package after adding the GPG key from Docker to ensure the downloads&#8217; validity.<\/p>\n\n\n\n<p>Before you begin, you must update your existing list of packages:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo apt-get update<\/code><\/pre>\n\n\n\n<p>Next, to enable apt to use packages over HTTPS, you will need to install a few prerequisite packages:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo apt install apt-transport-https ca-certificates curl software-properties-common<\/code><\/pre>\n\n\n\n<p>Now add the GPG key to your system\u2019s official Docker repository:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo mkdir -p \/etc\/apt\/keyrings\n$  curl -fsSL https:\/\/download.docker.com\/linux\/ubuntu\/gpg | sudo gpg --dearmor -o \/etc\/apt\/keyrings\/docker.gpg\n<\/code><\/pre>\n\n\n\n<p>Now add the Docker repository to APT sources:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ echo \\\n  \"deb [arch=$(dpkg --print-architecture) signed-by=\/etc\/apt\/keyrings\/docker.gpg] https:\/\/download.docker.com\/linux\/ubuntu \\\n  $(lsb_release -cs) stable\" | sudo tee \/etc\/apt\/sources.list.d\/docker.list &gt; \/dev\/null<\/code><\/pre>\n\n\n\n<p>Go ahead now and update the package database using the the newly added repo\u2019s Docker packages:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo apt-get update<\/code><\/pre>\n\n\n\n<p>Now the last thing in this step is to install Docker:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin<\/code><\/pre>\n\n\n\n<p>Docker is now installed, the daemon is running, and the process is set to start on boot. Verify that it\u2019s running:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo systemctl status docker<\/code><\/pre>\n\n\n\n<p>The output should show that the service is active and running and should look something like the following:<\/p>\n\n\n\n<pre title=\"Output\" class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">root@ServerB:\/home\/ubuntu# systemctl status docker\n\u25cf docker.service - Docker Application Container Engine\n     Loaded: loaded (\/lib\/systemd\/system\/docker.service; enabled; vendor preset: enabled)\n     Active: active (running) since Thu 2022-07-28 09:49:02 UTC; 8min ago\nTriggeredBy: \u25cf docker.socket\n       Docs: https:\/\/docs.docker.com\n   Main PID: 6958 (dockerd)\n      Tasks: 8\n     Memory: 30.2M\n        CPU: 1.276s\n     CGroup: \/system.slice\/docker.service\n             \u2514\u25006958 \/usr\/bin\/dockerd -H fd:\/\/ --containerd=\/run\/containerd\/containerd.sock<\/code><\/pre>\n\n\n\n<p>You now have the Docker service (daemon) as well as the docker command line program, commonly known as the Docker client, after installing Docker. Later in this article, we will learn how to utilize the docker command.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 2: Execute the Docker Command Without Sudo (Not Mandatory).<\/h2>\n\n\n\n<p>The docker command may only be executed by the root user or a member of the docker group, which is created by default during the Docker installation process. If you try to run the docker command without prefixing it with or being a member of the docker group, the output will look like this:<\/p>\n\n\n\n<pre title=\"Output\" class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">Got permission denied while trying to connect to the Docker daemon socket at unix:\/\/\/var\/run\/docker.sock: Get \"http:\/\/%2Fvar%2Frun%2Fdocker.sock\/v1.24\/containers\/json\": dial unix \/var\/run\/docker.sock: connect: permission denied<\/code><\/pre>\n\n\n\n<p>To avoid having to type <strong>sudo <\/strong>everytime you run the <strong>docker <\/strong>command, you need to add your username to the <strong>docker <\/strong>group:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo usermod -aG docker ${USER}<\/code><\/pre>\n\n\n\n<p>Log out of the server and back in or type the following in order to apply the new group membership:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ su - ${USER}<\/code><\/pre>\n\n\n\n<p>You will be prompted to enter your user password before proceeding:<\/p>\n\n\n\n<p>Type the following to confirm that your user is now added to the <strong>docker <\/strong>group:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ id -nG<\/code><\/pre>\n\n\n\n<pre title=\"Output\" class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">ubuntu adm cdrom sudo dip plugdev lxd docker<\/code><\/pre>\n\n\n\n<p>When needed, you can explicitly declare the username of the user you need to add to the <strong>docker <\/strong>group that you\u2019re not logged in as, through using:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo usermod -aG docker username<\/code><\/pre>\n\n\n\n<p>The rest of this guide is based on the fact that you are running the <strong>docker <\/strong>command as a user in the <strong>docker<\/strong> group. If you prefer not to, go ahead and prepend the commands with <strong>sudo<\/strong>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 3: Use the Docker Command<\/h2>\n\n\n\n<p>The use of <strong>docker <\/strong>means passing it on a chain of options and commands after which will come arguments. The syntax looks like the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ docker [option] [command] [arguments]<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ docker -v<\/code><\/pre>\n\n\n\n<pre title=\"Output\" class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">ubuntu@ServerB:~$ docker -v\nDocker version 20.10.17, build 100c701<\/code><\/pre>\n\n\n\n<p>To visualize all of the available subcommands, type:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ docker<\/code><\/pre>\n\n\n\n<p>The full list of all possible subcommands includes:<\/p>\n\n\n\n<pre title=\"Output\" class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">Commands:\n  attach      Attach local standard input, output, and error streams to a running container\n  build       Build an image from a Dockerfile\n  commit      Create a new image from a container's changes\n  cp          Copy files\/folders between a container and the local filesystem\n  create      Create a new container\n  diff        Inspect changes to files or directories on a container's filesystem\n  events      Get real time events from the server\n  exec        Run a command in a running container\n  export      Export a container's filesystem as a tar archive\n  history     Show the history of an image\n  images      List images\n  import      Import the contents from a tarball to create a filesystem image\n  info        Display system-wide information\n  inspect     Return low-level information on Docker objects\n  kill        Kill one or more running containers\n  load        Load an image from a tar archive or STDIN\n  login       Log in to a Docker registry\n  logout      Log out from a Docker registry\n  logs        Fetch the logs of a container\n  pause       Pause all processes within one or more containers\n  port        List port mappings or a specific mapping for the container\n  ps          List containers\n  pull        Pull an image or a repository from a registry\n  push        Push an image or a repository to a registry\n  rename      Rename a container\n  restart     Restart one or more containers\n  rm          Remove one or more containers\n  rmi         Remove one or more images\n  run         Run a command in a new container\n  save        Save one or more images to a tar archive (streamed to STDOUT by default)\n  search      Search the Docker Hub for images\n  start       Start one or more stopped containers\n  stats       Display a live stream of container(s) resource usage statistics\n  stop        Stop one or more running containers\n  tag         Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE\n  top         Display the running processes of a container\n  unpause     Unpause all processes within one or more containers\n  update      Update configuration of one or more containers\n  version     Show the Docker version information\n  wait        Block until one or more containers stop, then print their exit codes<\/code><\/pre>\n\n\n\n<p>To visualize the options possible for a specific command, type:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ docker docker-subcommand --help<\/code><\/pre>\n\n\n\n<p>To visualize the system-wide information regarding Docker, type:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ docker info<\/code><\/pre>\n\n\n\n<p>In this next step we will be exploring some of these images.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 4: Handling Docker Images<\/h2>\n\n\n\n<p>Images created with Docker are used to create containers. By default, Docker fetches these images from Docker Hub, which is a Docker registry managed by Docker. Because anybody may use <a href=\"https:\/\/hub.docker.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Docker Hub<\/a> to publish their images, the great majority of apps and Linux distributions will have images uploaded there.<\/p>\n\n\n\n<p>To verify if you have access and can download the images found on Docker Hub, type:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ docker run hello-world<\/code><\/pre>\n\n\n\n<p>The following output will tell you that Docker is correctly functioning:<\/p>\n\n\n\n<pre title=\"Output\" class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">ubuntu@ServerB:~$ docker run hello-world\nUnable to find image 'hello-world:latest' locally\nlatest: Pulling from library\/hello-world\n2db29710123e: Pull complete\nDigest: sha256:53f1bbee2f52c39e41682ee1d388285290c5c8a76cc92b42687eecf38e0af3f0\nStatus: Downloaded newer image for hello-world:latest\n\nHello from Docker!\nThis message shows that your installation appears to be working correctly.\n...<\/code><\/pre>\n\n\n\n<p>Docker was at first not able to find the <strong>hello-world <\/strong>image locally, so it proceeded to download it from Docker Hub, which is the default repository. Once the image has been downloaded, Docker created a container from it and had the application inside the container executed, while eventually displaying the message.<\/p>\n\n\n\n<p>You can find the images that are available on Docker Hub by using the <strong>docker <\/strong>command and the <strong>search <\/strong>subcommand. For example, to find the Ubuntu image you should type:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ docker search ubuntu<\/code><\/pre>\n\n\n\n<p>The script will go over Docker Hub and view a list of all images whose name match the search request. In this case, the output will look something like the following:<\/p>\n\n\n\n<pre title=\"Output\" class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">ubuntu@ServerB:~$ docker search ubuntu\nNAME                             DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED\nubuntu                           Ubuntu is a Debian-based Linux operating sys\u2026   14664     [OK]\nwebsphere-liberty                WebSphere Liberty multi-architecture images \u2026   286       [OK]\nubuntu-upstart                   DEPRECATED, as is Upstart (find other proces\u2026   112       [OK]\nneurodebian                      NeuroDebian provides neuroscience research s\u2026   92        [OK]\nubuntu\/nginx                     Nginx, a high-performance reverse proxy &amp; we\u2026   55\nopen-liberty                     Open Liberty multi-architecture images based\u2026   53        [OK]\nubuntu-debootstrap               DEPRECATED; use \"ubuntu\" instead                46        [OK]\nubuntu\/apache2                   Apache, a secure &amp; extensible open-source HT\u2026   39\nubuntu\/mysql                     MySQL open source fast, stable, multi-thread\u2026   36\nkasmweb\/ubuntu-bionic-desktop    Ubuntu productivity desktop for Kasm Workspa\u2026   31\n...<\/code><\/pre>\n\n\n\n<p>Once you picked the image that you\u2019ll be using, you can download it to your computer with the <strong>pull <\/strong>subcommand.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ docker pull ubuntu<\/code><\/pre>\n\n\n\n<p>The output you\u2019ll get will look like this:<\/p>\n\n\n\n<pre title=\"Output\" class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">ubuntu@ServerB:~$ docker pull ubuntu\nUsing default tag: latest\nlatest: Pulling from library\/ubuntu\n405f018f9d1d: Pull complete\nDigest: sha256:b6b83d3c331794420340093eb706a6f152d9c1fa51b262d9bf34594887c2c7ac\nStatus: Downloaded newer image for ubuntu:latest\ndocker.io\/library\/ubuntu:latest<\/code><\/pre>\n\n\n\n<p>After an image has been downloaded, you can then run a container using the downloaded image with the <code>run<\/code> subcommand. As you saw with the <code>hello-world<\/code> example, if an image has not been downloaded when <code>docker<\/code> is executed with the <strong>run <\/strong>subcommand, the Docker client will first download the image, then run a container using it.<\/p>\n\n\n\n<p>To view the images that have been downloaded to your computer, type the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ docker images<\/code><\/pre>\n\n\n\n<p>The output will look something like this:<\/p>\n\n\n\n<pre title=\"Output\" class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">ubuntu@ServerB:~$ docker images\nREPOSITORY    TAG       IMAGE ID       CREATED         SIZE\nubuntu        latest    27941809078c   7 weeks ago     77.8MB\nhello-world   latest    feb5d9fea6a5   10 months ago   13.3kB<\/code><\/pre>\n\n\n\n<p>You will later see in this tutorial how you can modify the images you use to run containers and use them to generate new images which may then be inserted (pushed is the technical term) into Docker Hub or other Docker registries.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 5: Running a Container in Docker<\/h2>\n\n\n\n<p>The <strong>hello-world <\/strong>container which you ran in the last step is an example of a container that, after emitting a test message, will run and exit. Containers can be more useful than this, as well as interactive. They function somewhat like virtual machines, only difference is that they\u2019re more resource-friendly.<\/p>\n\n\n\n<p>As an example, let\u2019s run a container and use the most recent image of Ubuntu. The combination of the -i and -t switches will give you interactive shell access into the container:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ docker run -it ubuntu<\/code><\/pre>\n\n\n\n<p>Your command prompt should be reformulated to show that you\u2019re now working inside the container and should look like this:<\/p>\n\n\n\n<pre title=\"Output\" class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">ubuntu@ServerB:~$ docker run -it ubuntu\nroot@a9bb67c47592:\/#<\/code><\/pre>\n\n\n\n<p>Look closely at the container id in the command prompt which is <strong>a9bb67c47592<\/strong> in here. That container ID is later necessary to identify the container when you want to delete it.<\/p>\n\n\n\n<p>Now you can run any command inside the container. For instance, when updating the package database inside the container you will not need to prefix any command with <strong>sudo<\/strong>, because you\u2019re operating inside the container as the <strong>root <\/strong>user:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">root@a9bb67c47592:\/# apt update<\/code><\/pre>\n\n\n\n<p>Now let\u2019s go ahead and install any application in it, Node.js for instance:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">root@a9bb67c47592:\/# apt install nodejs<\/code><\/pre>\n\n\n\n<p>This will install Node.js in the container found in the official Ubuntu repository. Once installed, verify that through:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">root@a9bb67c47592:\/# node -v<\/code><\/pre>\n\n\n\n<p>The version number will be displayed in your terminal:<\/p>\n\n\n\n<pre title=\"Output\" class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">v12.22.9<\/code><\/pre>\n\n\n\n<p>All the changes you make inside the container will only apply to that container.<\/p>\n\n\n\n<p>Type <strong>exit <\/strong>at the prompt to exit the container.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 6: Managing Containers in Docker<\/h2>\n\n\n\n<p>Once you have been on Docker for some time, you\u2019ll notice that there are many active (running) and inactive containers on your computer. To visualize the <strong>active ones<\/strong>, use:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ docker ps<\/code><\/pre>\n\n\n\n<p>The output you\u2019ll get is similar to this:<\/p>\n\n\n\n<pre title=\"Output\" class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">ubuntu@ServerB:~$ docker ps\nCONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES<\/code><\/pre>\n\n\n\n<p>You started two containers so far in the previous steps; one from the <strong>hello-world<\/strong> image and the second from the <strong>ubuntu <\/strong>image. Both of them are no longer running, but they\u2019re still on your system.<\/p>\n\n\n\n<p>To visualize both active and inactive containers , run <strong>docker ps<\/strong> with the<strong> -a<\/strong> switch:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ docker ps -a<\/code><\/pre>\n\n\n\n<p>You\u2019ll get a similar output:<\/p>\n\n\n\n<pre title=\"Output\" class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">ubuntu@ServerB:~$ docker ps -a\nCONTAINER ID   IMAGE         COMMAND    CREATED          STATUS                        PORTS     NAMES\na9bb67c47592   ubuntu        \"bash\"     6 minutes ago    Exited (127) 27 seconds ago             magical_shirley\nee421c96d926   hello-world   \"\/hello\"   30 minutes ago   Exited (0) 30 minutes ago               wonderful_raman<\/code><\/pre>\n\n\n\n<p>Pass the <code>-l<\/code> switch to visualize the last container you created:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ docker ps -l<\/code><\/pre>\n\n\n\n<pre title=\"Output\" class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">ubuntu@ServerB:~$ docker ps -l\nCONTAINER ID   IMAGE     COMMAND   CREATED          STATUS                        PORTS     NAMES\na9bb67c47592   ubuntu    \"bash\"    15 minutes ago   Exited (127) 10 minutes ago             magical_shirley<\/code><\/pre>\n\n\n\n<p>Use <code>docker start<\/code> to start a stopped container, followed by the ID of the container or its name. Let\u2019s start the one which is Ubuntu-based with the ID of <code>a9bb67c47592<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ docker start a9bb67c47592<\/code><\/pre>\n\n\n\n<p>You can use <strong>docker ps<\/strong> to see the container status once it starts:<\/p>\n\n\n\n<pre title=\"Output\" class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">ubuntu@ServerB:~$ docker ps\nCONTAINER ID   IMAGE     COMMAND   CREATED          STATUS              PORTS     NAMES\na9bb67c47592   ubuntu    \"bash\"    23 minutes ago   Up About a minute             magical_shirley<\/code><\/pre>\n\n\n\n<p>Use <code>docker stop<\/code> to stop a running container, followed by its ID or name. This time, we\u2019ll be using the name that Docker assigned to the container, which is <code>quizzical_mcnulty<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ docker stop magical_shirley<\/code><\/pre>\n\n\n\n<p>When you no longer need a container, you can remove it with the <code>docker rm<\/code> command, this time as well, using either the container ID or its name. Use the <code>docker ps -a<\/code> command to find the name or ID of the container that is associated with the <code>hello-world<\/code> image and delete it.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ docker rm wonderful_raman<\/code><\/pre>\n\n\n\n<p>You can create a new container and name it using the <code>--name<\/code> switch. It is also possible to use the<strong> <\/strong><code>--rm<\/code> switch to start a container that deletes itself when it gets stopped. See the <code>docker run help<\/code> command for more information on these options and other ones.<\/p>\n\n\n\n<p>I can transform containers into images, which can be used to build new containers.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 7: Bringing Changes Inside a Container to an Image on Docker<\/h2>\n\n\n\n<p>You can create, modify, and delete files just like with a virtual machine when you start up a Docker image. The changes that you make will apply to that one container only. I can start and stop it, but when I use the<strong> <\/strong><code>docker rm<\/code> command to destroy it, the changes are permanently lost.<\/p>\n\n\n\n<p>This part will show you how you can save a container\u2019s state as a new Docker image.<\/p>\n\n\n\n<p>Once you installed Node.js in the Ubuntu container, you now have one which runs off an image, but the container is not the same as the image that you used to make it. But you might want to use this Node.js container another time as the foundation for new images later on.<\/p>\n\n\n\n<p>Then make the changes to a new Docker image instance with the following command.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ docker commit -m \"What you did to the image\" -a \"Author Name\" container_id repository\/new_image_name<\/code><\/pre>\n\n\n\n<p>The <code>-m<\/code> switch is related to the commit message, which helps you and others identify the changes you made, however <code>-a<\/code> is used to specify the author. The <strong>container_id<\/strong> is the one you saw earlier in this guide when you launched the interactive Docker session. The <strong>repository<\/strong> is usually your Docker Hub username, unless you create new repositories on Docker Hub.<\/p>\n\n\n\n<p>For instance, for the user <strong>ubuntu<\/strong> whose container ID is <strong>a9bb67c47592<\/strong>, the command would be:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ docker commit -m \"added Node.js\" -a \"ubuntu\" a9bb67c47592 ubuntu\/ubuntu-nodejs<\/code><\/pre>\n\n\n\n<p>After I <em>commit<\/em> the image, I will have a new one saved locally on my computer. You\u2019ll later learn in this guide how to push an image to a Docker registry like Docker Hub, so other people can have access to it.<\/p>\n\n\n\n<p>Listing the Docker images again will visualise both the new and old ones that they came from:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ docker images<\/code><\/pre>\n\n\n\n<p>You\u2019ll see the following output:<\/p>\n\n\n\n<pre title=\"Output\" class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">ubuntu@ServerB:~$ docker images\nREPOSITORY             TAG       IMAGE ID       CREATED         SIZE\nubuntu\/ubuntu-nodejs   latest    45f8857f0719   9 seconds ago   197MB\n...<\/code><\/pre>\n\n\n\n<p>In this case, <code>ubuntu-nodejs<\/code> is the new image which was extracted from the existing <code>ubuntu<\/code> image from Docker Hub. The difference in size reflects the edits that I made. And the change I made is that <code>NodeJS<\/code> got installed. Therefore, the next time you will need to run a container with Ubuntu with NodeJS pre-installed, you can just use the new image.<\/p>\n\n\n\n<p>You can also create Images from a <strong>Dockerfile <\/strong>which lets you automate the installation of software within a new image. However, this is unrelated to this guide.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 8: Pushing a Docker Image to a Docker Repository<\/h2>\n\n\n\n<p>The next obvious step after creating a new image from an existing one is to share it with a few people you select, the wide public on Docker Hub, or other Docker registry that you can access. To push an image to Docker Hub or any other Docker registry, you need to have an account there.<\/p>\n\n\n\n<p>To do that, you need to first log into Docker Hub.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ docker login -u docker-registry-username<\/code><\/pre>\n\n\n\n<p>I will authenticate using your Docker Hub password.&nbsp;<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\">\n<p><strong>Note:<\/strong> If your Docker registry username differs from the local username you used to create the image, you will need to tag your image with your registry username. In the case of the last example, you would type:<\/p>\n<\/blockquote>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ docker tag ubuntu\/ubuntu-nodejs docker-registry-username\/ubuntu-nodejs<\/code><\/pre>\n\n\n\n<p>Then you will be able to push your own image using:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ docker push docker-registry-username\/docker-image-name<\/code><\/pre>\n\n\n\n<p>To push the <strong>ubuntu-nodejs<\/strong> image into the ubuntu repository, use the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ docker push ubuntu\/ubuntu-nodejs<\/code><\/pre>\n\n\n\n<p>Be patient as the process takes time while it uploads the images, but when completed, the output will be similar to this:<\/p>\n\n\n\n<pre title=\"Output\" class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">The push refers to a repository [docker.io\/ubuntu\/ubuntu-nodejs]\ne3fbbfb44187: Pushed\n5f70bf18a086: Pushed\na3b5c80a4eba: Pushed\n7f18b442972b: Pushed\n3ce512daaf78: Pushed\n7aae4540b42d: Pushed\n...<\/code><\/pre>\n\n\n\n<p>If there is any an error of this sort, then it is possibly because you did not log in:<\/p>\n\n\n\n<pre title=\"Output\" class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">The push refers to a repository [docker.io\/ubuntu\/ubuntu-nodejs]\ne3fbbfb44187: Preparing\n5f70bf18a086: Preparing\na3b5c80a4eba: Preparing\n7f18b442972b: Preparing\n3ce512daaf78: Preparing\n7aae4540b42d: Waiting\nunauthorized: authentication required<\/code><\/pre>\n\n\n\n<p>Log in with <strong>docker login<\/strong> and restart the pushing process again. Then verify that it is indeed on your Docker Hub repository page.<\/p>\n\n\n\n<p>It is now possible for you to use <strong>docker pull ubuntu\/ubuntu-nodejs<\/strong> to pull the image to a new machine and run a new container.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Docker, as a programme, simplifies the administration of application processes in containers, allowing you to execute your apps in resource-isolated processes. Containers are comparable to virtual machines, except they are more portable, resource-friendly, and dependent on the host operating system. This article will walk you through installing and configuring Docker Community Edition (CE) on ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/www.webhi.com\/how-to\/how-to-install-and-use-docker-on-ubuntu-lts\/\" title=\"read more...\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[69,182],"tags":[],"yoast_head":"\n<title>How To Install and Use Docker on Ubuntu 20.04\/22.04 LTS - WebHi Tutorials &amp; Documentations<\/title>\n<meta name=\"description\" content=\"This article will walk you through installing and configuring Docker Community Edition (CE) on Ubuntu 20.04 and 22.04.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.webhi.com\/how-to\/how-to-install-and-use-docker-on-ubuntu-lts\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Install and Use Docker on Ubuntu 20.04\/22.04 LTS - WebHi Tutorials &amp; Documentations\" \/>\n<meta property=\"og:description\" content=\"This article will walk you through installing and configuring Docker Community Edition (CE) on Ubuntu 20.04 and 22.04.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webhi.com\/how-to\/how-to-install-and-use-docker-on-ubuntu-lts\/\" \/>\n<meta property=\"og:site_name\" content=\"WebHi Tutorials &amp; Documentations\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webhi.technology\" \/>\n<meta property=\"article:published_time\" content=\"2022-07-31T12:09:48+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-07T16:10:07+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/docker_ubuntu_en.jpg\" \/>\n<meta name=\"author\" content=\"webhi\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@WebHiTechnology\" \/>\n<meta name=\"twitter:site\" content=\"@WebHiTechnology\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"webhi\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"16 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"TechArticle\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/how-to-install-and-use-docker-on-ubuntu-lts\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/how-to-install-and-use-docker-on-ubuntu-lts\/\"},\"author\":{\"name\":\"webhi\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/b31e76e2311cdc0bb90f5e2733059a54\"},\"headline\":\"How To Install and Use Docker on Ubuntu 20.04\/22.04 LTS\",\"datePublished\":\"2022-07-31T12:09:48+00:00\",\"dateModified\":\"2023-12-07T16:10:07+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/how-to-install-and-use-docker-on-ubuntu-lts\/\"},\"wordCount\":2105,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/#organization\"},\"articleSection\":[\"Linux system administration\",\"Virtualization &amp; Cloud computing\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.webhi.com\/how-to\/how-to-install-and-use-docker-on-ubuntu-lts\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/how-to-install-and-use-docker-on-ubuntu-lts\/\",\"url\":\"https:\/\/www.webhi.com\/how-to\/how-to-install-and-use-docker-on-ubuntu-lts\/\",\"name\":\"How To Install and Use Docker on Ubuntu 20.04\/22.04 LTS - WebHi Tutorials &amp; Documentations\",\"isPartOf\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/#website\"},\"datePublished\":\"2022-07-31T12:09:48+00:00\",\"dateModified\":\"2023-12-07T16:10:07+00:00\",\"description\":\"This article will walk you through installing and configuring Docker Community Edition (CE) on Ubuntu 20.04 and 22.04.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/how-to-install-and-use-docker-on-ubuntu-lts\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.webhi.com\/how-to\/how-to-install-and-use-docker-on-ubuntu-lts\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/how-to-install-and-use-docker-on-ubuntu-lts\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.webhi.com\/how-to\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How To Install and Use Docker on Ubuntu 20.04\/22.04 LTS\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#website\",\"url\":\"https:\/\/www.webhi.com\/how-to\/\",\"name\":\"WebHi Tutorials &amp; Documentations\",\"description\":\"System administration and knowledge base\",\"publisher\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.webhi.com\/how-to\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#organization\",\"name\":\"WebHi Technology\",\"url\":\"https:\/\/www.webhi.com\/how-to\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/logo.png\",\"contentUrl\":\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/logo.png\",\"width\":288,\"height\":95,\"caption\":\"WebHi Technology\"},\"image\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webhi.technology\",\"https:\/\/twitter.com\/WebHiTechnology\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/b31e76e2311cdc0bb90f5e2733059a54\",\"name\":\"webhi\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.webhi.com\/how-to\/ahuphiph\/litespeed\/avatar\/e20da107d0f4c765ead2eef88ad019d8.jpg?ver=1780005063\",\"contentUrl\":\"https:\/\/www.webhi.com\/how-to\/ahuphiph\/litespeed\/avatar\/e20da107d0f4c765ead2eef88ad019d8.jpg?ver=1780005063\",\"caption\":\"webhi\"},\"sameAs\":[\"https:\/\/www.webhi.com\/how-to\"],\"url\":\"https:\/\/www.webhi.com\/how-to\/author\/webhi\/\"}]}<\/script>\n","yoast_head_json":{"title":"How To Install and Use Docker on Ubuntu 20.04\/22.04 LTS - WebHi Tutorials &amp; Documentations","description":"This article will walk you through installing and configuring Docker Community Edition (CE) on Ubuntu 20.04 and 22.04.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.webhi.com\/how-to\/how-to-install-and-use-docker-on-ubuntu-lts\/","og_locale":"en_US","og_type":"article","og_title":"How To Install and Use Docker on Ubuntu 20.04\/22.04 LTS - WebHi Tutorials &amp; Documentations","og_description":"This article will walk you through installing and configuring Docker Community Edition (CE) on Ubuntu 20.04 and 22.04.","og_url":"https:\/\/www.webhi.com\/how-to\/how-to-install-and-use-docker-on-ubuntu-lts\/","og_site_name":"WebHi Tutorials &amp; Documentations","article_publisher":"https:\/\/www.facebook.com\/webhi.technology","article_published_time":"2022-07-31T12:09:48+00:00","article_modified_time":"2023-12-07T16:10:07+00:00","og_image":[{"url":"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/docker_ubuntu_en.jpg"}],"author":"webhi","twitter_card":"summary_large_image","twitter_creator":"@WebHiTechnology","twitter_site":"@WebHiTechnology","twitter_misc":{"Written by":"webhi","Est. reading time":"16 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"TechArticle","@id":"https:\/\/www.webhi.com\/how-to\/how-to-install-and-use-docker-on-ubuntu-lts\/#article","isPartOf":{"@id":"https:\/\/www.webhi.com\/how-to\/how-to-install-and-use-docker-on-ubuntu-lts\/"},"author":{"name":"webhi","@id":"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/b31e76e2311cdc0bb90f5e2733059a54"},"headline":"How To Install and Use Docker on Ubuntu 20.04\/22.04 LTS","datePublished":"2022-07-31T12:09:48+00:00","dateModified":"2023-12-07T16:10:07+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webhi.com\/how-to\/how-to-install-and-use-docker-on-ubuntu-lts\/"},"wordCount":2105,"commentCount":0,"publisher":{"@id":"https:\/\/www.webhi.com\/how-to\/#organization"},"articleSection":["Linux system administration","Virtualization &amp; Cloud computing"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webhi.com\/how-to\/how-to-install-and-use-docker-on-ubuntu-lts\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webhi.com\/how-to\/how-to-install-and-use-docker-on-ubuntu-lts\/","url":"https:\/\/www.webhi.com\/how-to\/how-to-install-and-use-docker-on-ubuntu-lts\/","name":"How To Install and Use Docker on Ubuntu 20.04\/22.04 LTS - WebHi Tutorials &amp; Documentations","isPartOf":{"@id":"https:\/\/www.webhi.com\/how-to\/#website"},"datePublished":"2022-07-31T12:09:48+00:00","dateModified":"2023-12-07T16:10:07+00:00","description":"This article will walk you through installing and configuring Docker Community Edition (CE) on Ubuntu 20.04 and 22.04.","breadcrumb":{"@id":"https:\/\/www.webhi.com\/how-to\/how-to-install-and-use-docker-on-ubuntu-lts\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webhi.com\/how-to\/how-to-install-and-use-docker-on-ubuntu-lts\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.webhi.com\/how-to\/how-to-install-and-use-docker-on-ubuntu-lts\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webhi.com\/how-to\/"},{"@type":"ListItem","position":2,"name":"How To Install and Use Docker on Ubuntu 20.04\/22.04 LTS"}]},{"@type":"WebSite","@id":"https:\/\/www.webhi.com\/how-to\/#website","url":"https:\/\/www.webhi.com\/how-to\/","name":"WebHi Tutorials &amp; Documentations","description":"System administration and knowledge base","publisher":{"@id":"https:\/\/www.webhi.com\/how-to\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webhi.com\/how-to\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.webhi.com\/how-to\/#organization","name":"WebHi Technology","url":"https:\/\/www.webhi.com\/how-to\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webhi.com\/how-to\/#\/schema\/logo\/image\/","url":"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/logo.png","contentUrl":"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/logo.png","width":288,"height":95,"caption":"WebHi Technology"},"image":{"@id":"https:\/\/www.webhi.com\/how-to\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webhi.technology","https:\/\/twitter.com\/WebHiTechnology"]},{"@type":"Person","@id":"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/b31e76e2311cdc0bb90f5e2733059a54","name":"webhi","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/image\/","url":"https:\/\/www.webhi.com\/how-to\/ahuphiph\/litespeed\/avatar\/e20da107d0f4c765ead2eef88ad019d8.jpg?ver=1780005063","contentUrl":"https:\/\/www.webhi.com\/how-to\/ahuphiph\/litespeed\/avatar\/e20da107d0f4c765ead2eef88ad019d8.jpg?ver=1780005063","caption":"webhi"},"sameAs":["https:\/\/www.webhi.com\/how-to"],"url":"https:\/\/www.webhi.com\/how-to\/author\/webhi\/"}]}},"_links":{"self":[{"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/posts\/257"}],"collection":[{"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/comments?post=257"}],"version-history":[{"count":81,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/posts\/257\/revisions"}],"predecessor-version":[{"id":7355,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/posts\/257\/revisions\/7355"}],"wp:attachment":[{"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/media?parent=257"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/categories?post=257"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/tags?post=257"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}