Node.js Web Server Deployed within Docker

Traducciones al Español
Estamos traduciendo nuestros guías y tutoriales al Español. Es posible que usted esté viendo una traducción generada automáticamente. Estamos trabajando con traductores profesionales para verificar las traducciones de nuestro sitio web. Este proyecto es un trabajo en curso.
Create a Linode account to try this guide with a $ credit.
This credit will be applied to any valid services used during your first  days.

Node.js is a server-side, JavaScript package, often used for various cloud applications. Docker is a container platform. With Docker, users can download applications without the hassle of the installation and configuration process.

Install Docker

To install Docker CE (Community Edition), follow the instructions within one of the guides below:

For complete instructions on even more Linux distributions, reference the Install Docker Engine section of Docker’s official documentation.

Download the Docker Node.js Server Image

The Docker Hub user page for Linode can be accessed here. Select the server-node-js image for configuration information.

Note
Docker images made for one operating system can be used on servers running a different OS. The server-node-js Ubuntu 14.04 image was tested on Debian 7, Ubuntu 14.04, CentOS 7 and Fedora 21. After Docker installation on CentOS and Fedora, run the sudo service docker start command.
  1. Search for linode images:

    docker search linode
    
  2. Download the linode/server-node-js image:

    docker pull linode/server-node-js
    

Run the Docker Container, Node.js, and the Web Server

  1. Run the Linode container. Forward the Linode’s port 80 to port 3000 of the container:

    docker run -d -p 80:3000 linode/server-node-js
    
    Note
    This command runs the docker image as a daemon.
  2. Test the server at example.com/test.htm, replacing example.com with your Linode’s IP address. A page with “Test File” should appear.

The Docker Hub image page has information explaining what the Docker image contains.

More Information

You may wish to consult the following resources for additional information on this topic. While these are provided in the hope that they will be useful, please note that we cannot vouch for the accuracy or timeliness of externally hosted materials.

This page was originally published on


Your Feedback Is Important

Let us know if this guide was helpful to you.


Join the conversation.
Read other comments or post your own below. Comments must be respectful, constructive, and relevant to the topic of the guide. Do not post external links or advertisements. Before posting, consider if your comment would be better addressed by contacting our Support team or asking on our Community Site.
The Disqus commenting system for Linode Docs requires the acceptance of Functional Cookies, which allow us to analyze site usage so we can measure and improve performance. To view and create comments for this article, please update your Cookie Preferences on this website and refresh this web page. Please note: You must have JavaScript enabled in your browser.