Documentation renewed! For old docs, visit doc.newapi.pro
New APINew API
User GuideInstallationAPI ReferenceAI ApplicationsSkillsHelp & SupportBusiness Cooperation

1Panel Panel Deployment

This document provides a graphical tutorial for deploying New API using the 1Panel panel.

Prerequisites

ItemRequirement
1Panel PanelLatest stable version
Recommended OSLinux (Ubuntu/CentOS/Debian, etc.)
Server ConfigurationAt least 1 core and 2GB RAM

Step 1: Install 1Panel Panel

Install 1Panel Panel

For information on 1Panel installation, deployment, and basic features, please refer to the 1Panel Official Documentation

After completing the 1Panel installation and deployment, open your browser to the prompted URL to access the 1Panel panel.

1panel

Step 2: Install New API

Search for Applications

Search for Applications

Go to the application list in the App Store, find the New API application under the [AI] category, and install it.

1panel-newapi

Configure Parameters

Install Application

Configure New API application parameters on the installation page:

  • Name: The name of the New API application to be created
  • Version: Select the version of New API
  • Port: The service port for the New API application
  • Timezone: Enter the timezone where the server is located (default Asia/Shanghai)
  • Advanced Settings: Be sure to check external port access

newapi-setting

Confirm Installation

Confirm Installation

Click Confirm to start the installation. The page will automatically redirect to the installed applications list. Wait for the New API application status to change to Started.

newapi-start

Step 3: Configure Environment Variables (Important)

After installation, it is recommended to configure the following key environment variables:

Required Environment Variables

VariableDescriptionRequired
SESSION_SECRETSession secret, must be consistent for multi-node deploymentRequired
CRYPTO_SECRETEncryption secret, required when using RedisConditional

Configuration Method

  1. In the 1Panel application list, click the Parameters button for the New API application
  2. Add in the environment variables section:
    • SESSION_SECRET=your_random_secret_key
    • CRYPTO_SECRET=your_crypto_secret_key (optional)
  3. Click Confirm to save the configuration
  4. Restart the application for the configuration to take effect

Generate Random Secrets

# Generate SESSION_SECRET
openssl rand -hex 16

# Or use Linux command
head -c 16 /dev/urandom | xxd -p

Step 4: Access New API

Access Application

  • On the Installed page, click Jump to enter the New API WebUI page
  • Before use, it is recommended to set the Default Access Address on the Panel Settings page

newapi-visit

The first visit will automatically guide you to the initialization page. Follow the on-screen instructions to set up an administrator account and password.

Common Issues

Cannot access application interface

  1. Check if the application status is "Started"
  2. Confirm that the port is correctly mapped and open
  3. Check the server firewall and cloud server security group

Session invalid after login

Ensure the SESSION_SECRET environment variable is set and not empty.

How to update version

  1. Log in to 1Panel panel, go to App StoreUpgradable page
  2. Find the New API application, click the Upgrade button
  3. Select the target version, click Confirm

How to persist data

1Panel applications store data in Docker volumes by default. To customize storage location:

  1. In the application parameter settings, configure directory mapping
  2. Ensure the /data directory is mapped to persistent storage

How is this guide?

Last updated on