<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Kevin Suchetan</title>
    <description>The latest articles on Forem by Kevin Suchetan (@kevin_tupili).</description>
    <link>https://forem.com/kevin_tupili</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3404458%2F3de7dd2b-eea7-4dd2-8c16-ab9972491379.jpg</url>
      <title>Forem: Kevin Suchetan</title>
      <link>https://forem.com/kevin_tupili</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/kevin_tupili"/>
    <language>en</language>
    <item>
      <title>How to SSH Into a VirtualBox Ubuntu VM From Windows - Password Authentication (Step-By-Step Guide)</title>
      <dc:creator>Kevin Suchetan</dc:creator>
      <pubDate>Mon, 17 Nov 2025 19:00:37 +0000</pubDate>
      <link>https://forem.com/kevin_tupili/how-to-ssh-into-a-virtualbox-ubuntu-vm-from-windows-password-authentication-step-by-step-guide-3843</link>
      <guid>https://forem.com/kevin_tupili/how-to-ssh-into-a-virtualbox-ubuntu-vm-from-windows-password-authentication-step-by-step-guide-3843</guid>
      <description>&lt;p&gt;If you're running Ubuntu in VirtualBox on Windows and want to SSH into it from your Windows terminal - this guide walks you through everything clearly.&lt;/p&gt;

&lt;p&gt;This is perfect if you want to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Practice Linux server administration&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Access your VM like a remote machine&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Simulate multiple user sessions&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Run commands from Windows without using the VM window&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let’s get started.&lt;/p&gt;




&lt;h3&gt;
  
  
  Step-1. Install OpenSSH Server Inside the Ubuntu VM
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Open your Ubuntu terminal and switch to root (optional but convenient):
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo -i
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Install the SSH server:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apt install openssh-server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqm2lzjfoo05q7p7yvyq3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqm2lzjfoo05q7p7yvyq3.png" alt="Image showing " width="800" height="182"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Check whether SSH server is running:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;systemctl status ssh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkijrdx14nftlgk44id1b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkijrdx14nftlgk44id1b.png" alt="Image showing " width="788" height="298"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you see &lt;strong&gt;"active (running)"&lt;/strong&gt;, you're good.&lt;/p&gt;




&lt;h3&gt;
  
  
  Step-2. Enable Password Authentication (Optional but Needed Here)
&lt;/h3&gt;

&lt;p&gt;SSH sometimes disables password login by default.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open the SSH server config:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nano /etc/ssh/sshd_config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Find this line:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#PasswordAuthentication no
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Change it to:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PasswordAuthentication yes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjl77jfq2nztu8talprkw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjl77jfq2nztu8talprkw.png" alt="Image showing the " width="800" height="406"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Save and exit(Ctrl X and then 'y'), then restart SSH:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;systemctl restart ssh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Step-3. Set Up VirtualBox Port Forwarding (The Key Step)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt; Your VM is behind VirtualBox's NAT network, which means:&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt; It can access the internet &lt;/li&gt;
&lt;li&gt; But outside machines (like Windows) cannot access the VM directly&lt;/li&gt;
&lt;/ul&gt;




&lt;/ul&gt;

&lt;ul&gt;
&lt;li&gt;To allow SSH traffic from Windows to Ubuntu VM, we create a forwarding rule.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In VirtualBox:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;i. Select your Ubuntu VM&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ii. &lt;em&gt;Settings &amp;gt; Network &amp;gt; Adapter 1&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;iii. Attached to: NAT&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;iv. &lt;em&gt;Click Advanced &amp;gt; Port Forwarding&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flljnaqru6rpmed4xjazo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flljnaqru6rpmed4xjazo.png" alt="Image showing Port Forwarding Option" width="800" height="619"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add rule:&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Name&lt;/th&gt;
&lt;th&gt;Protocol&lt;/th&gt;
&lt;th&gt;Host IP&lt;/th&gt;
&lt;th&gt;Host Port&lt;/th&gt;
&lt;th&gt;Guest IP&lt;/th&gt;
&lt;th&gt;Guest Port&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;SSH&lt;/td&gt;
&lt;td&gt;TCP&lt;/td&gt;
&lt;td&gt;127.0.0.1&lt;/td&gt;
&lt;td&gt;2222&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;22&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fke985cwwye3smoyuoetj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fke985cwwye3smoyuoetj.png" alt="Image showing port forwarding rule" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;(Guest IP can be left blank - VirtualBox fills it automatically)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;This tells VirtualBox:
"When Windows sends traffic to 127.0.0.1:2222, forward it to the VM's port 22."&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Step-4. Check if Windows Has the SSH Client
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Windows 10 and 11 already ship with OpenSSH client.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Use Windows terminal to Verify:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh -V
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you get a version number, it's installed.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;If not, enable it:&lt;br&gt;
&lt;em&gt;Settings &amp;gt; System &amp;gt; Optional features &amp;gt; Add a feature &amp;gt; "OpenSSH Client"&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;No firewall changes are usually needed since outbound connections are allowed.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step-5. SSH From Windows Into the Ubuntu VM
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Open Windows Terminal or CMD and run:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh -p 2222 &amp;lt;your-ubuntu-username&amp;gt;@127.0.0.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Enter your Ubuntu user password - and you're inside the VM from Windows!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1nw7ajqqso1rlcuh2924.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1nw7ajqqso1rlcuh2924.png" alt="Image showing ubuntu user login inside windows" width="800" height="486"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;Wrap-Up&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;With just NAT port forwarding and a few configuration tweaks, your Windows machine can SSH into your Ubuntu VM exactly like a real remote server. Perfect for learning Linux, DevOps, or cloud workflows.&lt;/p&gt;

&lt;p&gt;If you found this helpful, drop a comment - happy hacking!&lt;/p&gt;

</description>
      <category>ubuntu</category>
      <category>networking</category>
      <category>linux</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Creating a Docker Image from a Running Container</title>
      <dc:creator>Kevin Suchetan</dc:creator>
      <pubDate>Fri, 01 Aug 2025 03:34:22 +0000</pubDate>
      <link>https://forem.com/kevin_tupili/creating-a-docker-image-from-a-running-container-4g13</link>
      <guid>https://forem.com/kevin_tupili/creating-a-docker-image-from-a-running-container-4g13</guid>
      <description>&lt;p&gt;If you've made changes inside a running Docker container and want to save those changes, you can commit the container as a new image. In this short guide, we'll walk through how to do that:&lt;/p&gt;

&lt;p&gt;Let's create a simple Express app with just one file, index.js, and then build a Docker image from it. After that, we'll run a container using that image. Once the container is up and running, we'll make changes to the code inside the container and then commit those changes into a new Docker image.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;index.js&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const express = require('express');
const app = express();

app.get('/', (req, res) =&amp;gt; {
    res.send("Welcome to Home Page");
});

app.listen(8080, () =&amp;gt; console.log("Server Listening on 8080"));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Dockerfile&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FROM node:14-alpine

WORKDIR '/usr/app/'

COPY './package.json' ./
RUN npm install
COPY ./ ./

CMD ["npm", "start"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After creating the Dockerfile, run the build command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker build -t kevin3302/express-app . 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, let's run the container:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker run -p 5000:8080 kevin3302/express-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can access the website at &lt;code&gt;http://localhost:5000&lt;/code&gt;.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyy9rr871xzcgi25vqmda.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyy9rr871xzcgi25vqmda.png" alt="Image Showing Website at http://localhost:5000" width="534" height="255"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now that our container is running, the next step is to access it and make the necessary code changes. To do that, we first need to find the container ID.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Step-1: Check the container ID&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;To get the container ID of the running container, In a new terminal run:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker ps 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will list all running containers with their IDs, names, and other details. We'll need the container ID to access the container and modify the code inside.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F57vwaf3i85jfizxofadn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F57vwaf3i85jfizxofadn.png" alt="Image showing Container ID" width="800" height="177"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, we'll enter the shell of the running container to modify the code directly inside it.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Step 2: Enter the running container&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Use the following command to open a interactive shell inside the running container:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker exec -it f72330919ee5 sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace &lt;em&gt;f72330919ee5&lt;/em&gt; with your actual container ID if it's different.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Step 3: Modify the code inside the container&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Once inside the container, open &lt;strong&gt;index.js&lt;/strong&gt; using a text editor like vi or nano.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In the home route, change the response text from:&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;res.send("Welcome to Home Page");&lt;/code&gt;&lt;br&gt;
to:&lt;br&gt;
&lt;code&gt;res.send("Hello World");&lt;/code&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Step 4: Commit the running container as a new image&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;In a new terminal (outside the container), run:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker commit f72330919ee5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using the running container ID with &lt;strong&gt;docker commit&lt;/strong&gt; creates a new Docker image from the current state of the running container.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmbihgx7q3gsirh934xx2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmbihgx7q3gsirh934xx2.png" alt="Image showing docker commit command to build a new image" width="800" height="94"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We can tag the newly created image using:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker tag &amp;lt;new-image-id&amp;gt; &amp;lt;tag-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj0dp5b5cw81wxixz987x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj0dp5b5cw81wxixz987x.png" alt="Image showing the execution of docker tag command" width="800" height="55"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Also, we can change the startup command for the new image by specifying it with &lt;code&gt;-c flag&lt;/code&gt;:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker commit -c 'CMD &amp;lt;new-startup-command&amp;gt;' &amp;lt;new-image-id&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Step 5: Run the new container
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Now, run a container from the newly created image using:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker run -p 5001:8080 &amp;lt;new-image-id or tag&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will start the container with your modified code.&lt;/p&gt;

&lt;p&gt;We can access the modified website at &lt;code&gt;http://localhost:5001&lt;/code&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fovfbxc9z9whvegq7bcqe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fovfbxc9z9whvegq7bcqe.png" alt="Image showing the modified app at http://localhost:5001" width="607" height="259"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;Committing a running container to a new image is a quick way to save changes made inside a container. However, for development purposes, a better approach is to use Docker volumes, which allows us to modify the code on our host machine and see the changes reflected instantly inside the container - without needing to rebuild or commit.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>docker</category>
      <category>devops</category>
      <category>tutorial</category>
      <category>learning</category>
    </item>
  </channel>
</rss>
