How To Install node-http-server on Debian 12

Learn how to install node-http-server on Debian 12 with this tutorial. node-http-server is Simple zero-configuration command-line http server

Introduction

In this tutorial we learn how to install node-http-server on Debian 12.

What is node-http-server

node-http-server is:

http-server is a simple, zero-configuration command-line static HTTP server powerful enough for production usage, but simple enough to be used for testing, local development and learning.

There are three methods to install node-http-server on Debian 12. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install node-http-server Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install node-http-server using apt-get by running the following command:

sudo apt-get -y install node-http-server

Install node-http-server Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install node-http-server using apt by running the following command:

sudo apt -y install node-http-server

Install node-http-server Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Debian. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install node-http-server using aptitude by running the following command:

sudo aptitude -y install node-http-server

How To Uninstall node-http-server on Debian 12

To uninstall only the node-http-server package we can use the following command:

sudo apt-get remove node-http-server

Uninstall node-http-server And Its Dependencies

To uninstall node-http-server and its dependencies that are no longer needed by Debian 12, we can use the command below:

sudo apt-get -y autoremove node-http-server

Remove node-http-server Configurations and Data

To remove node-http-server configuration and data from Debian 12 we can use the following command:

sudo apt-get -y purge node-http-server

Remove node-http-server configuration, data, and all of its dependencies

We can use the following command to remove node-http-server configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge node-http-server

Dependencies

node-http-server have the following dependencies:

References

Summary

In this tutorial we learn how to install node-http-server package on Debian 12 using different package management tools: apt, apt-get and aptitude.