Installing on Windows
Installing PostgreSQL
Please refer to the PostgreSQL Installation Guide to install and configure PostgreSQL.
After installation, create a database user and database for Palpo:
-
Open "SQL Shell (psql)" from the Start Menu, or run
psql -U postgresin the terminal.Enter the password configured during installation as prompted. If you encounter an error message like "command not found," please check if the installation path of PostgreSQL is included in the Windows environment variable PATH. -
Execute the following in the psql shell:
Replace 'your_secure_password' with a strong password. This creates a PostgreSQL user and database named palpo, and sets the user as the database owner.
Downloading Palpo Release
Download officeal release
Visit the official GitHub releases page:
https://github.com/palpo-im/palpo/releases
Download the latest Windows version (e.g., palpo-x.y.z-windows.zip) and extract it.
Install from Source Code
Windows Environment
- Configure the Rust Development Environment
Obtain the Windows installer from the official Rust website: https://rust-lang.org/tools/install/
Double-click the installer and select the Quick install option. During installation, you will be prompted to install dependencies such as the Windows SDK. After these tools finish installing, proceed with the Rust toolchain installation using default settings, and wait for components (e.g., rustc, cargo) to complete installation.Verify the installation success in PowerShell or Command Prompt (CMD) by running the following commands:
If you receive a "command not found" error, configure the PATH environment variable in Windows System Settings.
- Obtain the Palpo Source Code
Visit the official Palpo GitHub repository: https://github.com/palpo-im/palpo
- If Git is installed: Use the
git clonecommand to fetch the source code. - If you prefer not to use Git: Directly download the source code package by selecting Download ZIP on the GitHub repository page.
- Compile the Source Code
Before compilation, install CMake first. You have two installation options:
- Download the installer from the official CMake website: https://cmake.org/download/
- Install via Winget (Windows Package Manager) with this command:
compile Palpo
- Navigate to the Palpo source code directory.
- Open a terminal in this directory and execute the following command. Wait for compilation to finish:
The Windows executable (palpo.exe) will be generated in the ./target/release/ subdirectory of the source code folder. This is a standalone executable with no external DLL dependencies—you can copy it to any directory for use.
Cross-Compilation and Installation on WSL Environment
If you have the Windows Subsystem for Linux (WSL) configured on your Windows machine, you can cross-compile Palpo to generate a Windows binary directly in WSL. This avoids configuring the Rust toolchain on Windows natively and simplifies multi-platform build workflows, though additional pre-configuration is required.
- Configure the Cross-Compilation Toolchain
Add the Windows target to the Rust toolchain in WSL and install the MinGW64 cross-compiler (commands vary by Linux distribution):
- Compile Dependent PostgreSQL Libraries
The official PostgreSQL binaries are built with the Visual Studio (VS) toolchain, but cross-compilation in WSL uses MinGW64. You must manually compile the required PostgreSQL libraries (not the full PostgreSQL software) to complete cross-compilation: a. Download the PostgreSQL source code: https://www.postgresql.org/ftp/source/ b. Extract the source code package and navigate to the PostgreSQL root directory. c. Configure compilation parameters (exclude unnecessary libraries):
d. Compile only the required libraries:
e. After compilation, locate the MinGW-compiled static libraries (.a files) at these paths:
* src/interfaces/libpq/libpq.a
* src/common/libpgcommon.a
* src/port/libpgport.a
f. Copy these .a files to a dedicated directory (we use postgresql/lib-mingw32 in this guide for consistency).
- Configure Cross-Compilation for Palpo
In the Palpo source code directory, create a .cargo/config.toml file with the following content to specify cross-compilation settings:
- Run Cross-Compilation
Execute the following command and wait for compilation to complete:
The Windows binary will be generated in the target/x86_64-pc-windows-gnu/release/ directory. Copy it to a Windows directory to run.
Notes on Running Cross-Compiled Binaries
Cross-compiled binaries use dynamic linking by default. Double-clicking the generated .exe file on Windows will trigger this error (or no valid output in the terminal):
This occurs because Palpo requires the MinGW dynamic library libwinpthread-1.dll to run.
- Locate
libwinpthread-1.dllin WSL (path may vary by distribution):
- Copy this DLL file to the same directory as
palpo-mingw.exeon Windows, then proceed with Palpo configuration.
Configuring Palpo
Copy the example configuration file and rename it:
Edit palpo.toml according to your environment and database settings. At minimum, you need to:
-
Set
server_nameto your desired domain, for example: -
Set the database URL in the
[db]section to match the database, user, and password you created above, for example:
Replace your.domain.com and your_secure_password with your actual domain and password.
Use localhost as the domain name for local testing.
For more advanced configuration, please refer to the Configuration Page.
Running Palpo
Start Palpo from the command line:
Setting Up as a Windows Service (Auto-start on Boot)
You can use the built-in sc command or NSSM (recommended, Non-Sucking Service Manager) to enable Palpo to start automatically on boot.
Using NSSM (Recommended)
-
Download and install NSSM.
-
Open Command Prompt as Administrator and run:
-
In the NSSM interface:
- Set the path to
palpo.exe - Set the startup directory to the folder containing
palpo.exe - Click "Install service"
- Set the path to
-
Start the service:
Using Windows Built-in Service Manager (Advanced)
You can also create a service using the sc command:
Replace C:\\path\\to\\palpo.exe with the actual path to the Palpo executable.
Palpo will now start automatically on boot. {/* 本行由工具自动生成,原文哈希值:8d6bf9b2dacdf6172cb54f60a30db81d */}