{"id":10971,"date":"2024-02-19T07:36:01","date_gmt":"2024-02-19T07:36:01","guid":{"rendered":"https:\/\/greenwebpage.com\/community\/?p=10971"},"modified":"2024-03-30T11:16:28","modified_gmt":"2024-03-30T11:16:28","slug":"how-to-build-node-js-application-with-docker-on-ubuntu-22-04","status":"publish","type":"post","link":"https:\/\/greenwebpage.com\/community\/how-to-build-node-js-application-with-docker-on-ubuntu-22-04\/","title":{"rendered":"How to Build Node.js Application With Docker on Ubuntu 22.04"},"content":{"rendered":"<p><a href=\"https:\/\/nodejs.org\/en\">Node.js<\/a> is widely recognized for its powerful functionalities, including the development of server-side applications using JavaScript. While, <a href=\"https:\/\/www.docker.com\/\">Docker<\/a> is utilized for containerization, packaging, and deploying applications.<\/p>\n<p>By integrating Node.js with Docker, you can create portable and consistent environments for your applications across various platforms.<\/p>\n<p>This comprehensive guide illustrates the complete process of building a Node.js application and deploying it using Docker on <a href=\"https:\/\/greenwebpage.com\/community\/what-is-ubuntu-understanding-linux-distribution\/\">Ubuntu 22.04<\/a>.<\/p>\n<h2><strong>How to Build Node.js Application With Docker on Ubuntu 22.04?<\/strong><\/h2>\n<p>Follow these step-by-step instructions to build a Node.js application with Docker on your Linux systems, including Ubuntu 22.04.<\/p>\n<p><strong>Step 1: Verify Docker Status<\/strong><\/p>\n<p>Without Docker, you cannot build a Docker image on your system. Therefore, ensure that you have already installed Docker and it is properly running:<\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<pre>sudo systemctl status docker<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre><img fetchpriority=\"high\" decoding=\"async\" width=\"961\" height=\"581\" class=\"wp-image-10972\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-1.png\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-1.png 961w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-1-300x181.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-1-768x464.png 768w\" sizes=\"(max-width: 961px) 100vw, 961px\" \/><\/pre>\n<p><strong>Step 2: Confirm Node.js Installation<\/strong><\/p>\n<p>To create a Node.js application, you must have Node.js installed on your Ubuntu 22.04 machine. Confirm the installed version of Node.js by executing the following command:<\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<pre>node --version<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre><img decoding=\"async\" width=\"935\" height=\"77\" class=\"wp-image-10973\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-2.png\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-2.png 935w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-2-300x25.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-2-768x63.png 768w\" sizes=\"(max-width: 935px) 100vw, 935px\" \/><\/pre>\n<p>The Node.js version number (v21.6.2) will also be used in the Dockerfile to ensure compatibility.<\/p>\n<h2><strong>How to Build the Node.js Application?<\/strong><\/h2>\n<p>Using these few steps leads to building a Node.js application on your system.<\/p>\n<p><strong>Step 1: Create Project Directory<\/strong><\/p>\n<p>To build a Node.js application, begin by creating a separate project directory, such as \u201cnode-docker-app\u201d:<\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<pre>mkdir node-docker-app<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre><img decoding=\"async\" width=\"899\" height=\"54\" class=\"wp-image-10974\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-3.png\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-3.png 899w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-3-300x18.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-3-768x46.png 768w\" sizes=\"(max-width: 899px) 100vw, 899px\" \/><\/pre>\n<p><strong>Step 2: Navigate to Project Directory<\/strong><\/p>\n<p>After creating a new project directory, use the <strong>cd<\/strong> command to navigate inside the directory:<\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<pre>cd node-docker-app<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre><img loading=\"lazy\" decoding=\"async\" width=\"941\" height=\"52\" class=\"wp-image-10975\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-4.png\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-4.png 941w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-4-300x17.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-4-768x42.png 768w\" sizes=\"(max-width: 941px) 100vw, 941px\" \/><\/pre>\n<p><strong>Step 3: Initialize Node.js Project<\/strong><\/p>\n<p>To initialize a new Node.js project with default settings, run the command from your terminal:<\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<pre>npm init -y<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre><img loading=\"lazy\" decoding=\"async\" width=\"963\" height=\"438\" class=\"wp-image-10976\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-5.png\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-5.png 963w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-5-300x136.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-5-768x349.png 768w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-5-960x438.png 960w\" sizes=\"(max-width: 963px) 100vw, 963px\" \/><\/pre>\n<p><strong>Step 4: Create Application File (App.js)<\/strong><\/p>\n<p>Now, you can create the application file (app.js) for your Node.js application using a text editor like Nano:<\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<pre>sudo nano app.js<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre><img loading=\"lazy\" decoding=\"async\" width=\"972\" height=\"53\" class=\"wp-image-10977\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-6.png\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-6.png 972w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-6-300x16.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-6-768x42.png 768w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-6-960x53.png 960w\" sizes=\"(max-width: 972px) 100vw, 972px\" \/><\/pre>\n<p>This command will open a blank page on your screen.<\/p>\n<p>Simply, copy the following script and save the file:<\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<pre>const http = require('http'); \n\nconst hostname = '0.0.0.0'; \nconst port = 3000; \n\nconst server = http.createServer((req, res) =&gt; { \nres.statusCode = 200; \nres.setHeader('Content-Type', 'text\/plain'); \nres.end('Congratulations! You have successfully built a Node.js application with Docker\\n'); \n}); \n\nserver.listen(port, hostname, () =&gt; { \nconsole.log(`Server running at http:\/\/${hostname}:${port}\/`); \n});<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1156\" height=\"615\" class=\"wp-image-10978\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-7.png\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-7.png 1156w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-7-300x160.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-7-1024x545.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-7-768x409.png 768w\" sizes=\"(max-width: 1156px) 100vw, 1156px\" \/><\/p>\n<p><strong>Note:<\/strong> You can provide the port number (i.e. 3000) of your own choice.<\/p>\n<p>So far, you have created a Node.js application. Now, let&#8217;s jump to the next step to create a Docker file.<\/p>\n<h2><strong>How to Create Dockerfile for Node.js Application?<\/strong><\/h2>\n<p>Utilize the below commands to create and deploy your Node.js application with Docker.<\/p>\n<p><strong>Step 1: Create a \u201cDockerfile\u201d for Your Application<\/strong><\/p>\n<p>To define the configuration for your Docker image, create a new file like &#8220;Dockerfile&#8221; through the command:<\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<pre>sudo nano Dockerfile<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre><img loading=\"lazy\" decoding=\"async\" width=\"984\" height=\"54\" class=\"wp-image-10979\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-8.png\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-8.png 984w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-8-300x16.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-8-768x42.png 768w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-8-960x54.png 960w\" sizes=\"(max-width: 984px) 100vw, 984px\" \/><\/pre>\n<p>Within the Dockerfile, specify the setup and dependencies based on your application requirements:<\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<pre># Use the Node.js version\n\nFROM node:21\n\n# Set the directory\n\nWORKDIR \/usr\/src\/app\n\nCOPY package*.json .\/\n\n# Dependencies\n\nRUN npm install\n\nCOPY . .\n\n# Set port\n\nEXPOSE 3000\n\n# Run the application\n\nCMD [\"node\", \"app.js\"]<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"970\" height=\"625\" class=\"wp-image-10980\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-9.png\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-9.png 970w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-9-300x193.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-9-768x495.png 768w\" sizes=\"(max-width: 970px) 100vw, 970px\" \/><\/p>\n<p>Make sure that you have entered the correct values, especially for the <strong>FROM node:<\/strong> and <strong>EXPOSE<\/strong>, as the mismatched values may cause your application to fail.<\/p>\n<p><strong>Step 2: Build Docker Image<\/strong><\/p>\n<p>Run the command to create a Docker image of your Node.js application (node-docker-app) based on the instructions in the Dockerfile:<\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<pre>sudo docker build -t node-docker-app .<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre><img loading=\"lazy\" decoding=\"async\" width=\"986\" height=\"531\" class=\"wp-image-10981\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-10.png\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-10.png 986w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-10-300x162.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-10-768x414.png 768w\" sizes=\"(max-width: 986px) 100vw, 986px\" \/><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"978\" height=\"534\" class=\"wp-image-10982\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-11.png\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-11.png 978w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-11-300x164.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-11-768x419.png 768w\" sizes=\"(max-width: 978px) 100vw, 978px\" \/><\/p>\n<p><strong>Step 3: Run Docker Container <\/strong><\/p>\n<p>Now, run a Docker container based on the specified Docker image, such as &#8220;node-docker-app&#8221;:<\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<pre>sudo docker run -d -p 3000:3000 node-docker-app<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre><img loading=\"lazy\" decoding=\"async\" width=\"1155\" height=\"78\" class=\"wp-image-10983\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-12.png\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-12.png 1155w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-12-300x20.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-12-1024x69.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-12-768x52.png 768w\" sizes=\"(max-width: 1155px) 100vw, 1155px\" \/><\/pre>\n<p>The <strong>-p 3000:3000<\/strong> is a dedicated port number, you can use a custom port number as per your <strong>app.js <\/strong>and <strong>Dockerfile<\/strong>.<\/p>\n<p><strong>Step 4: Verify Container Status<\/strong><\/p>\n<p>Once you have completed the above steps, let\u2019s verify that your &#8220;node-docker-app&#8221; container is running correctly, use the provided command:<\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<pre>sudo docker ps<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre><img loading=\"lazy\" decoding=\"async\" width=\"1156\" height=\"149\" class=\"wp-image-10984\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-13.png\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-13.png 1156w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-13-300x39.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-13-1024x132.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-13-768x99.png 768w\" sizes=\"(max-width: 1156px) 100vw, 1156px\" \/><\/pre>\n<p>You will see the Docker image of your Node.js application listed in your terminal, confirming that the image has been successfully created and is accessible on <strong>port 3000<\/strong>.<\/p>\n<p><strong>Step 5: Access Your Node.js Application <\/strong><\/p>\n<p>To access your Node.js application, open your web browser and copy the following URL:<\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<pre>localhost:3000<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre><img loading=\"lazy\" decoding=\"async\" width=\"994\" height=\"561\" class=\"wp-image-10985\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-14.png\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-14.png 994w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-14-300x169.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/word-image-10971-14-768x433.png 768w\" sizes=\"(max-width: 994px) 100vw, 994px\" \/><\/pre>\n<p>You have successfully built and containerized your Node.js application using Docker on Ubuntu 22.04.<\/p>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p>You can use simple steps to build a Node.js application with Docker on your Linux systems like Ubuntu 22.04. First, you must have installed the Docker and Node.js packages on your system. After initializing the Node.js project, create an application file with the Node.js script.<\/p>\n<p>Next, create a Dockerfile and build a docker image via <strong>\u201csudo docker build -t node-docker-app\u201d<\/strong>. Finally, run the command <strong>\u201csudo docker run -d -p 3000:3000 node-docker-app\u201d<\/strong> to containerize your Node.js application.<\/p>\n<p>This comprehensive guide explored the easiest way to build Node.js application with Docker on Ubuntu 22.04.<\/p>\n\n    <div class=\"xs_social_share_widget xs_share_url after_content \t\tmain_content  wslu-style-1 wslu-share-box-shaped wslu-fill-colored wslu-none wslu-share-horizontal wslu-theme-font-no wslu-main_content\">\n\n\t\t\n        <ul>\n\t\t\t        <\/ul>\n    <\/div> \n","protected":false},"excerpt":{"rendered":"<p>Node.js is widely recognized for its powerful functionalities, including the development of server-side applications using JavaScript. While, Docker is utilized for containerization, packaging, and deploying applications. By integrating Node.js with Docker, you can create portable and consistent environments for your applications across various platforms. This comprehensive guide illustrates the complete process of building a Node.js [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":11004,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[43],"tags":[227,278,224],"class_list":["post-10971","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-docker","tag-node-js","tag-ubuntu-22-04"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Build Node.js Application With Docker on Ubuntu 22.04 - Greenwebpage Community<\/title>\n<meta name=\"description\" content=\"This comprehensive guide illustrates the complete process of building a Node.js application and deploying it using Docker on Ubuntu 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:\/\/greenwebpage.com\/community\/how-to-build-node-js-application-with-docker-on-ubuntu-22-04\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Build Node.js Application With Docker on Ubuntu 22.04 - Greenwebpage Community\" \/>\n<meta property=\"og:description\" content=\"This comprehensive guide illustrates the complete process of building a Node.js application and deploying it using Docker on Ubuntu 22.04.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/greenwebpage.com\/community\/how-to-build-node-js-application-with-docker-on-ubuntu-22-04\/\" \/>\n<meta property=\"og:site_name\" content=\"Greenwebpage Community\" \/>\n<meta property=\"article:published_time\" content=\"2024-02-19T07:36:01+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-30T11:16:28+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/How-to-Build-Node.js-Application-With-Docker-on-Ubuntu-22.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1020\" \/>\n\t<meta property=\"og:image:height\" content=\"600\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Karim Buzdar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Karim Buzdar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-build-node-js-application-with-docker-on-ubuntu-22-04\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-build-node-js-application-with-docker-on-ubuntu-22-04\/\"},\"author\":{\"name\":\"Karim Buzdar\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/467c100c1d017bc081473ee0440680c8\"},\"headline\":\"How to Build Node.js Application With Docker on Ubuntu 22.04\",\"datePublished\":\"2024-02-19T07:36:01+00:00\",\"dateModified\":\"2024-03-30T11:16:28+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-build-node-js-application-with-docker-on-ubuntu-22-04\/\"},\"wordCount\":676,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/#organization\"},\"image\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-build-node-js-application-with-docker-on-ubuntu-22-04\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/How-to-Build-Node.js-Application-With-Docker-on-Ubuntu-22.jpg\",\"keywords\":[\"Docker\",\"Node.js\",\"Ubuntu 22.04\"],\"articleSection\":[\"Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/greenwebpage.com\/community\/how-to-build-node-js-application-with-docker-on-ubuntu-22-04\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-build-node-js-application-with-docker-on-ubuntu-22-04\/\",\"url\":\"https:\/\/greenwebpage.com\/community\/how-to-build-node-js-application-with-docker-on-ubuntu-22-04\/\",\"name\":\"How to Build Node.js Application With Docker on Ubuntu 22.04 - Greenwebpage Community\",\"isPartOf\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-build-node-js-application-with-docker-on-ubuntu-22-04\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-build-node-js-application-with-docker-on-ubuntu-22-04\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/How-to-Build-Node.js-Application-With-Docker-on-Ubuntu-22.jpg\",\"datePublished\":\"2024-02-19T07:36:01+00:00\",\"dateModified\":\"2024-03-30T11:16:28+00:00\",\"description\":\"This comprehensive guide illustrates the complete process of building a Node.js application and deploying it using Docker on Ubuntu 22.04.\",\"breadcrumb\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-build-node-js-application-with-docker-on-ubuntu-22-04\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/greenwebpage.com\/community\/how-to-build-node-js-application-with-docker-on-ubuntu-22-04\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-build-node-js-application-with-docker-on-ubuntu-22-04\/#primaryimage\",\"url\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/How-to-Build-Node.js-Application-With-Docker-on-Ubuntu-22.jpg\",\"contentUrl\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/How-to-Build-Node.js-Application-With-Docker-on-Ubuntu-22.jpg\",\"width\":1020,\"height\":600,\"caption\":\"How to Build Node.js Application With Docker on Ubuntu 22\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-build-node-js-application-with-docker-on-ubuntu-22-04\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/greenwebpage.com\/community\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Build Node.js Application With Docker on Ubuntu 22.04\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#website\",\"url\":\"https:\/\/greenwebpage.com\/community\/\",\"name\":\"Greenwebpage Community\",\"description\":\"Get online in three steps with our wide range of web hosting solutions. Choose from professional business to enterprise options designed to meet your needs.\",\"publisher\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/greenwebpage.com\/community\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#organization\",\"name\":\"Greenwebpage Community\",\"url\":\"https:\/\/greenwebpage.com\/community\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2023\/10\/cropped-logomic.png\",\"contentUrl\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2023\/10\/cropped-logomic.png\",\"width\":512,\"height\":512,\"caption\":\"Greenwebpage Community\"},\"image\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/467c100c1d017bc081473ee0440680c8\",\"name\":\"Karim Buzdar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/0628fcbcddd9bc5486245d2cf4a904dbcdeac9ad6c3098f49237094e9d513d0c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/0628fcbcddd9bc5486245d2cf4a904dbcdeac9ad6c3098f49237094e9d513d0c?s=96&d=mm&r=g\",\"caption\":\"Karim Buzdar\"},\"sameAs\":[\"https:\/\/greenwebpage.com\"],\"url\":\"https:\/\/greenwebpage.com\/community\/author\/karim\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Build Node.js Application With Docker on Ubuntu 22.04 - Greenwebpage Community","description":"This comprehensive guide illustrates the complete process of building a Node.js application and deploying it using Docker on Ubuntu 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:\/\/greenwebpage.com\/community\/how-to-build-node-js-application-with-docker-on-ubuntu-22-04\/","og_locale":"en_US","og_type":"article","og_title":"How to Build Node.js Application With Docker on Ubuntu 22.04 - Greenwebpage Community","og_description":"This comprehensive guide illustrates the complete process of building a Node.js application and deploying it using Docker on Ubuntu 22.04.","og_url":"https:\/\/greenwebpage.com\/community\/how-to-build-node-js-application-with-docker-on-ubuntu-22-04\/","og_site_name":"Greenwebpage Community","article_published_time":"2024-02-19T07:36:01+00:00","article_modified_time":"2024-03-30T11:16:28+00:00","og_image":[{"width":1020,"height":600,"url":"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/How-to-Build-Node.js-Application-With-Docker-on-Ubuntu-22.jpg","type":"image\/jpeg"}],"author":"Karim Buzdar","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Karim Buzdar","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/greenwebpage.com\/community\/how-to-build-node-js-application-with-docker-on-ubuntu-22-04\/#article","isPartOf":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-build-node-js-application-with-docker-on-ubuntu-22-04\/"},"author":{"name":"Karim Buzdar","@id":"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/467c100c1d017bc081473ee0440680c8"},"headline":"How to Build Node.js Application With Docker on Ubuntu 22.04","datePublished":"2024-02-19T07:36:01+00:00","dateModified":"2024-03-30T11:16:28+00:00","mainEntityOfPage":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-build-node-js-application-with-docker-on-ubuntu-22-04\/"},"wordCount":676,"commentCount":0,"publisher":{"@id":"https:\/\/greenwebpage.com\/community\/#organization"},"image":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-build-node-js-application-with-docker-on-ubuntu-22-04\/#primaryimage"},"thumbnailUrl":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/How-to-Build-Node.js-Application-With-Docker-on-Ubuntu-22.jpg","keywords":["Docker","Node.js","Ubuntu 22.04"],"articleSection":["Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/greenwebpage.com\/community\/how-to-build-node-js-application-with-docker-on-ubuntu-22-04\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/greenwebpage.com\/community\/how-to-build-node-js-application-with-docker-on-ubuntu-22-04\/","url":"https:\/\/greenwebpage.com\/community\/how-to-build-node-js-application-with-docker-on-ubuntu-22-04\/","name":"How to Build Node.js Application With Docker on Ubuntu 22.04 - Greenwebpage Community","isPartOf":{"@id":"https:\/\/greenwebpage.com\/community\/#website"},"primaryImageOfPage":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-build-node-js-application-with-docker-on-ubuntu-22-04\/#primaryimage"},"image":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-build-node-js-application-with-docker-on-ubuntu-22-04\/#primaryimage"},"thumbnailUrl":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/How-to-Build-Node.js-Application-With-Docker-on-Ubuntu-22.jpg","datePublished":"2024-02-19T07:36:01+00:00","dateModified":"2024-03-30T11:16:28+00:00","description":"This comprehensive guide illustrates the complete process of building a Node.js application and deploying it using Docker on Ubuntu 22.04.","breadcrumb":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-build-node-js-application-with-docker-on-ubuntu-22-04\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/greenwebpage.com\/community\/how-to-build-node-js-application-with-docker-on-ubuntu-22-04\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/greenwebpage.com\/community\/how-to-build-node-js-application-with-docker-on-ubuntu-22-04\/#primaryimage","url":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/How-to-Build-Node.js-Application-With-Docker-on-Ubuntu-22.jpg","contentUrl":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/How-to-Build-Node.js-Application-With-Docker-on-Ubuntu-22.jpg","width":1020,"height":600,"caption":"How to Build Node.js Application With Docker on Ubuntu 22"},{"@type":"BreadcrumbList","@id":"https:\/\/greenwebpage.com\/community\/how-to-build-node-js-application-with-docker-on-ubuntu-22-04\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/greenwebpage.com\/community\/"},{"@type":"ListItem","position":2,"name":"How to Build Node.js Application With Docker on Ubuntu 22.04"}]},{"@type":"WebSite","@id":"https:\/\/greenwebpage.com\/community\/#website","url":"https:\/\/greenwebpage.com\/community\/","name":"Greenwebpage Community","description":"Get online in three steps with our wide range of web hosting solutions. Choose from professional business to enterprise options designed to meet your needs.","publisher":{"@id":"https:\/\/greenwebpage.com\/community\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/greenwebpage.com\/community\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/greenwebpage.com\/community\/#organization","name":"Greenwebpage Community","url":"https:\/\/greenwebpage.com\/community\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/greenwebpage.com\/community\/#\/schema\/logo\/image\/","url":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2023\/10\/cropped-logomic.png","contentUrl":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2023\/10\/cropped-logomic.png","width":512,"height":512,"caption":"Greenwebpage Community"},"image":{"@id":"https:\/\/greenwebpage.com\/community\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/467c100c1d017bc081473ee0440680c8","name":"Karim Buzdar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/0628fcbcddd9bc5486245d2cf4a904dbcdeac9ad6c3098f49237094e9d513d0c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0628fcbcddd9bc5486245d2cf4a904dbcdeac9ad6c3098f49237094e9d513d0c?s=96&d=mm&r=g","caption":"Karim Buzdar"},"sameAs":["https:\/\/greenwebpage.com"],"url":"https:\/\/greenwebpage.com\/community\/author\/karim\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/posts\/10971","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/comments?post=10971"}],"version-history":[{"count":3,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/posts\/10971\/revisions"}],"predecessor-version":[{"id":11229,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/posts\/10971\/revisions\/11229"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/media\/11004"}],"wp:attachment":[{"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/media?parent=10971"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/categories?post=10971"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/tags?post=10971"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}