Installation Guide (Windows Server)
This guide provides step-by-step instructions for installing and configuring the Metadata Editor on Windows server.
System Requirements
Before beginning the installation, ensure your system meets the following requirements:
| Component | Requirement |
|---|---|
| PHP | Version 8.2 or later |
| MySQL | Version 8.x or MariaDB 10.x or later |
| Python | Version 3.12 |
| Windows Service Manager | NSSM (for running services) |
| Version Control | GIT (optional, for updates) |
| IIS | If using IIS, PHP Manager is recommended |
Installation Procedure
Step 1: Install PHP
Download PHP
- Visit php.net
- Select PHP 8.2 or later
- Important for IIS users: Download the Non-Thread Safe (NTS) version
Configure PHP for IIS
If using IIS, use PHP Manager for installation:
- Download: PHP Manager for IIS 10
- Alternatively, manually edit the
php.iniconfiguration file
Enable Required PHP Extensions
Edit the php.ini file located in your PHP installation directory and enable the following extensions:
extension=mysqli
extension=xsl
extension=openssl
extension=curl
extension=mbstring
extension=zipConfigure PHP Runtime Settings
Update the following settings in php.ini:
memory_limit = 528M
max_execution_time = 60
post_max_size = 2000M
upload_max_filesize = 2000M
display_errors = OnStep 2: Install MySQL Database
Download MySQL
- Download MySQL: dev.mysql.com/downloads/mysql
- Download MySQL Workbench: dev.mysql.com/downloads/workbench
Configuration During Installation
When installing MySQL:
- Set a strong password for the root user
- Note your password—you'll need it later
MySQL Workbench provides a graphical interface for managing your databases. Refer to the official documentation for detailed usage instructions.
Step 3: Install Python
- Download Python 3.12 from python.org/downloads/windows
- Run the installer
- Important: Check the box to "Add Python to PATH" during installation
- Complete the installation wizard
Step 4: Install Metadata Editor Frontend
Create Folder Structure
Create the following directory structure:
C:\inetpub\wwwroot\metadata_editor\
├── editor\
└── editor-fastapi\Note: For IIS installations, use C:\inetpub\wwwroot\metadata_editor
Download Editor Source Code
- Visit github.com/worldbank/metadata-editor
- Click the Code button
- Select Download ZIP
- Extract the contents into the
editor\folder

Step 5: Install Metadata Editor FastAPI Backend
The FastAPI backend handles data processing tasks including importing/exporting SPSS and STATA files and generating statistics.
Download FastAPI Application
- Visit github.com/worldbank/metadata-editor-fastapi
- Click the Code button
- Select Download ZIP
- Extract the contents into the
editor-fastapi\folder

Install FastAPI Dependencies
Open Command Prompt and navigate to the editor-fastapi folder:
cd C:\inetpub\wwwroot\metadata_editor\editor-fastapi
pip install -r requirements.txt
Test FastAPI Installation
To verify the installation works, run:
python -m uvicorn main:app --reload --host 0.0.0.0 --port 8000
You should see output confirming the application is running. Open your browser and visit http://localhost:8000 to verify.

Step 6: Configure Database
Create Database
Using MySQL Workbench (GUI) or command line, create a new database:
CREATE DATABASE metadata_editor;Create Database User
Create a dedicated user account for the application:
CREATE USER 'editor_user'@'localhost' IDENTIFIED BY 'your-secure-password';
GRANT ALL PRIVILEGES ON metadata_editor.* TO 'editor_user'@'localhost';
FLUSH PRIVILEGES;Replace 'your-secure-password' with a strong password and remember it for the next step.
For detailed instructions, see the MySQL Workbench documentation.
Step 7: Configure Metadata Editor
Update Database Connection Settings
- Navigate to
editor\application\config\ - Copy or rename
database.sample.phptodatabase.php - Edit
database.phpin a text editor (Notepad or Notepad++) - Update the following values:
$db['default'] = array(
'dsn' => '',
'hostname' => 'localhost', // or IP address of database server
'username' => 'editor_user',
'password' => 'your-secure-password',
'database' => 'metadata_editor',
// ... other settings
);
5. Save the file
Set Folder Permissions
Configure read/write permissions for the following directories:
Editor Folders:
/Editor/Datafiles//Editor/Files//Editor/Logs/
FastAPI Folders:
/editor-fastapi/Jobs/
For IIS: Set these permissions through IIS Manager or file properties dialog.
Configure IIS (Web Server)
- Open Internet Information Services (IIS) Manager
- Create a new website or virtual directory pointing to:
C:\inetpub\wwwroot\metadata_editor\editor - Important: Point to the
editorsubfolder, not the parentmetadata_editorfolder - Set the appropriate app pool and permissions
Run the Web Installer
- Open a web browser
- Navigate to your Metadata Editor URL:
- Local:
http://localhost - In subfolder:
http://localhost/editor
- Local:
- Follow the on-screen installation wizard to complete setup
Step 8: Run FastAPI as a Windows Service
(Optional but recommended for production environments)
To run FastAPI automatically on system startup, follow these steps:
Download NSSM
- Visit nssm.cc/download
- Download the latest version
- Extract to a folder, e.g.,
C:\nssm
Create Startup Batch File
- Create a new file
run-pydatatools.batin theeditor-fastapi\folder - Add the following lines:
pip install -r requirements.txt
python -m uvicorn main:app --host 0.0.0.0 --port 8000- Save the file
Install Windows Service
- Open Command Prompt as Administrator
- Run the NSSM installer:
C:\nssm\nssm.exe install- Fill in the following fields:
- Path: Full path to
run-pydatatools.bat - Startup directory: Path to
editor-fastapifolder - Service name:
pydatatools(or your preferred name)
- Path: Full path to

- Click Install service
Add Python to System PATH
To ensure the service can find Python:
- Press Windows Key and search for "System environment variables"
- Click Edit the system environment variables

- Click Environment Variables...
- Under System variables, find and select Path
- Click Edit
- Click New and add the path to your Python installation (e.g.,
C:\Users\YourUsername\AppData\Local\Programs\Python\Python312)

- Click OK on all dialogs
Verify Service Installation
- Press Windows Key and search for "Services"
- Look for
pydatatoolsin the list

- If not running, right-click and select Start
- Open your browser and visit
http://localhost:8000to verify
Troubleshooting
Common Issues
Service won't start:
- Verify Python path is added to system environment variables
- Check that the batch file path is correct
- Review Windows Event Viewer for error messages
Database connection error:
- Verify MySQL is running
- Confirm username and password in
database.php - Check that the database and user were created successfully
Permission denied errors:
- Ensure IIS app pool identity has read/write permissions to required folders
- Check folder ownership and NTFS permissions
PHP extensions not loading:
- Verify extension lines are uncommented in
php.ini - Check that extension DLL files exist in the
ext\folder - Restart IIS or PHP service after changes
Next Steps
Once installation is complete:
- Initial Configuration: Log in to the Metadata Editor and configure basic settings
- User Management: Create user accounts and assign roles
- Data Import: Load your initial datasets