Deploying YApi Interface Management Platform Locally on Windows

YApi serves as an efficient, open-source interface management platform designed to assist developers, product managers, and testers in creating, publishing, and maintaining APIs. Setting up YApi on a local Windows environment requires a specific stack and configuration process.

Prerequisites

Before initiating the deployment, ensure the following software is installed and configured on the system:

  • Node.js (LTS version recommended)
  • MongoDB (Database service)
  • Git (Version control)

Source Code Acquisition

Obtain the source code from the official GitHub repository or a mirror repository if network speed is an issue.

git clone https://github.com/YMFE/yapi.git

Alternatively, use the Gitee mirror:

git clone https://gitee.com/mirrors/YApi.git

Installation and Configuration

Navigate to the project root directory. Install the YApi command-line interface tool globally to facilitate the visual deployment process.

npm install -g yapi-cli

Once installed, start the configuration server.

yapi server

If the browser does not load the page correctly at localhost:9090, try running the server command without specific registry flags or check network proxy settings.

Access the deployment interface via a web browser at http://localhost:9090. Follow the on-screen wizard to input database connection details (MongoDB) and set administrator credentials. Upon successful submission, the system will compile the necessary files.

After the deployment script finishes, navigate to the output directory specified during configuration (default is often the current directory or a subfolder named yapi). Start the application server using Node.js:

node vendors/server/app.js

The platform should now be accessible at http://localhost:3000.

Process Management with PM2

Running the application directly via the Node command binds the process to the current terminal session. Closing the window terminates the service. To ensure the service runs persistently in the background, use PM2 for process management.

First, install PM2 globally:

npm install -g pm2

Change into the YApi deployment directory and start the service with a custom name for easier identification:

pm2 start vendors/server/app.js --name yapi-server

The service is now managed by PM2 and will restart automatically if it crashes or if the system reboots (provided PM2 startup scripts are configured). Common PM2 commands for managing the instance include:

pm2 list                  # View all running processes
pm2 info yapi-server      # Display detailed process information
pm2 stop yapi-server      # Stop the service
pm2 restart yapi-server   # Restart the service

Tags: YAPI Windows API Management Node.js mongodb

Posted on Sat, 19 Sep 2026 16:23:27 +0000 by radley