How to Share Your Express.js Application from Localhost


Updated on Nov 11, 2025
ยท 8 mins read
Express.js Node.js Pinggy guide Tunneling Remote Access JavaScript

How to Share Your Express.js Application from Localhost

Building web applications with Express.js is incredibly fast and flexible, but when it comes time to share your work with teammates, clients, or testers, things get complicated. Your Express.js app runs beautifully on localhost, but the moment someone else needs to see it, you’re faced with deployment hassles, cloud configurations, or firewall nightmares. What if you could bypass all that complexity and share your local Express.js server instantly?

In this guide, we’ll show you how to expose your Express.js application to the internet in seconds using Pinggy, without deploying to any server or configuring your network settings.

Summary

  1. Initialize a new Node.js project

    npm init -y
    
  2. Install Express.js and create a simple server

    npm install express
    

    Create app.js with a basic Express.js server and run:

    node app.js
    
  3. Share your local Express.js app using Pinggy

    ssh -p 443 -R0:localhost:3000 -t free.pinggy.io
    

    Access your Express.js app via the provided Pinggy public URL (e.g., https://your-app.pinggy.link).

What Is Express.js?

Express.js is a minimal and flexible Node.js web application framework that provides a robust set of features for building web and mobile applications. Created to make building web servers with Node.js simpler and more intuitive, Express.js has become the de facto standard for Node.js web development.

Key Features of Express.js

  • Minimalist and Unopinionated: Express.js gives you the freedom to structure your application however you want, without forcing you into a specific architecture.
  • Robust Routing: Express.js provides a powerful routing mechanism that makes it easy to handle different HTTP methods and URL patterns.
  • Middleware Ecosystem: The middleware architecture allows you to add functionality to your application through reusable components, from authentication to logging.
  • Performance: Built on Node.js, Express.js is incredibly fast and can handle thousands of concurrent connections with minimal overhead.
  • Massive Community: With millions of downloads per week, Express.js has one of the largest ecosystems in the JavaScript world, with countless plugins and extensions.

Whether you’re building a REST API, a real-time application, a microservice, or a full-stack web application, Express.js provides the foundation to get it done quickly and efficiently.

Why Share Your Express.js App from Localhost?

When you’re developing an Express.js application locally, it typically runs on localhost:3000 or 127.0.0.1:3000, which is only accessible from your own machine. This creates several challenges:

  • Client Demos: You can’t easily showcase your progress to clients without deploying or resorting to screen sharing.
  • Team Collaboration: Remote teammates can’t test features or provide feedback on your local development environment.
  • Webhook Testing: Many third-party services like payment processors, chatbots, and authentication providers require a public URL to send webhooks.
  • Mobile Testing: Testing your Express.js app on mobile devices becomes cumbersome without a public URL.

Traditional solutions involve deploying to staging servers or cloud platforms, which is time-consuming and often unnecessary for quick demos or testing. Using Pinggy, you can create a secure tunnel that makes your local Express.js application accessible to anyone on the internet, no deployment required.

Prerequisites

Before we begin, make sure you have:

  • Node.js 14+: Installed on your system. Download from Node.js official website.
  • npm or yarn: Package manager (comes with Node.js installation).
  • SSH Client: Built-in on macOS/Linux; Windows users can use Git Bash or OpenSSH.
  • Basic Terminal Knowledge: Familiarity with running commands in the terminal.
  • Pinggy Account (Optional): For custom domains and advanced features.

Step 1: Set Up Your Express.js Project

Let’s start by creating a fresh Express.js project. If you already have an Express.js app running, you can skip to Step 2.

Initialize a New Node.js Project

First, create a new directory for your project and initialize it with npm:

# Create a new directory
mkdir my-express-app
cd my-express-app

# Initialize npm project
npm init -y

The -y flag automatically accepts all default options, creating a package.json file with standard settings.

Initialize npm Project

Install Express.js

Now install Express.js as a dependency:

npm install express

This command downloads Express.js and adds it to your package.json dependencies. You’ll see a node_modules folder created with all the necessary packages.

Install Express.js Package

Create Your Express.js Server

Create a new file called app.js in your project directory and add the following code:

const express = require('express');
const app = express();
const PORT = 3000;

// Middleware to parse JSON
app.use(express.json());

// Basic route
app.get('/', (req, res) => {
  res.send('<h1>Welcome to Express.js!</h1><p>Your server is running successfully.</p>');
});

// API endpoint example
app.get('/api/hello', (req, res) => {
  res.json({ message: 'Hello from Express.js!', timestamp: new Date() });
});

// Start the server
app.listen(PORT, () => {
  console.log(`Server is running on http://localhost:${PORT}`);
});

This creates a simple Express.js server with two routes: a homepage that returns HTML and an API endpoint that returns JSON.

Start Your Express.js Server

Run your server with:

node app.js

You should see output like:

Server is running on http://localhost:3000

Open your browser and visit http://localhost:3000. You’ll see your welcome message, confirming everything is working correctly. Try visiting http://localhost:3000/api/hello to see the JSON response.

Run Express.js Server Express.js App Running on Localhost Express.js JSON Response

Step 2: Share Your Express.js App with Pinggy

Now comes the exciting part. Open a new terminal window (keep your Express.js server running in the first one) and run this command:

Pinggy Command

Understanding the Command

Let’s break down what this command does:

  • ssh -p 443: Establishes a secure SSH connection to Pinggy’s server on port 443 (HTTPS port, which works even on restrictive networks).
  • -R0:localhost:3000: Creates a reverse tunnel that maps your local Express.js app (running on port 3000) to a public URL.
  • -L4300:localhost:4300: Sets up local port forwarding for Pinggy’s web debugger interface.
  • -t free.pinggy.io: Specifies the Pinggy server to connect to.

What You’ll See

After running the command, Pinggy will output something like:

You can access local server via following URL(s):
https://rnssh-12-34-56-78.a.pinggy.link

Web Debugger: http://localhost:4300
Pinggy Public URL

That’s it! Your Express.js application is now publicly accessible. Anyone can visit the Pinggy URL and interact with your app as if it were deployed on a real server.

Step 3: Test Your Public Express.js App

Copy the Pinggy URL from your terminal and paste it into any browser. You should see your Express.js application load perfectly. Try accessing your API endpoints by appending /api/hello to the Pinggy URL. Share it with colleagues, test it on your phone, or use it with webhook services - everything works seamlessly.

Express.js App Running on Pinggy Public URL Access JSON Response Using Pinggy Public URL

The web debugger at http://localhost:4300 is particularly useful. It shows you all incoming HTTP requests in real-time, including headers, query parameters, request bodies, and response data. This is invaluable for debugging webhooks, API integrations, and understanding how external services interact with your application.

Advanced Pinggy Features for Express.js

Pinggy offers several advanced features that make it even more powerful for Express.js development:

Custom Domains

Instead of using a random Pinggy subdomain, you can use your own custom domain. This is perfect for professional demos or when you need a branded URL for client presentations.

Visit Pinggy's documentation to learn how to set up custom domains.

Persistent URLs

By default, Pinggy generates a new URL each time you create a tunnel. With a Pinggy Pro account, you can get persistent URLs that remain the same across sessions, making it easier to share with clients and configure in third-party services.

Authentication and Access Control

Pinggy allows you to add password protection to your tunnels, ensuring that only authorized users can access your Express.js application. This is particularly useful when sharing sensitive development work with clients.

Secure your tunnel by appending a username and password to your SSH command:

ssh -p 443 -R0:localhost:3000 -t free.pinggy.io b:username:password

You can also configure multiple username-password pairs for enhanced access control. For more details, refer to the official documentation.

Common Use Cases for Sharing Express.js Apps

Here are some scenarios where sharing your Express.js app from localhost is incredibly useful:

  1. Client Demos: Show your progress to clients without deploying to a staging server or dealing with cloud configurations.
  2. Webhook Development: Test integrations with services like Stripe, Twilio, Slack, or GitHub that require public URLs for webhooks.
  3. Mobile Testing: Access your Express.js app from mobile devices on any network to test responsive designs and mobile-specific features.
  4. Remote Collaboration: Let team members test features, review your work, or debug issues in real-time without complex VPN setups.
  5. OAuth Testing: Test social authentication flows with providers like Google, Facebook, or GitHub that require callback URLs.
  6. API Development: Share your Express.js REST APIs with frontend developers, mobile app developers, or third-party integrators.
  7. IoT and Hardware Testing: Connect IoT devices or hardware projects to your Express.js backend without complex network configurations.

Conclusion

Sharing your Express.js application from localhost has never been easier. With Pinggy, you can transform your local development server into a publicly accessible application in seconds, without dealing with deployment pipelines, cloud configurations, or network settings. Whether you’re demoing to clients, testing webhooks, collaborating with remote teammates, or developing APIs, Pinggy provides a fast, secure, and developer-friendly solution.

The combination of Express.js’s lightweight framework and Pinggy’s instant tunneling creates a workflow that lets you focus on building great applications instead of wrestling with infrastructure. Give it a try on your next Express.js project - you’ll wonder how you ever lived without it.