Skip to content

Installation

This guide walks through setting up Niuton on a Debian/Ubuntu server or LXC container.

1. System Setup

bash
# Update system
apt update && apt upgrade -y

# Install required packages
apt install -y apache2 libapache2-mod-php8.1 \
  php8.1-pgsql php8.1-mbstring php8.1-json \
  php8.1-gd php8.1-xml php8.1-curl \
  postgresql postgresql-client \
  curl unzip

2. Database Setup

bash
# Switch to postgres user
sudo -u postgres psql

# Create database and user
CREATE USER niuton_user WITH PASSWORD 'your_secure_password';
CREATE DATABASE niuton_db OWNER niuton_user ENCODING 'UTF8';
GRANT ALL PRIVILEGES ON DATABASE niuton_db TO niuton_user;
\q

Database Encoding

PostgreSQL must use UTF-8 encoding. If your database uses SQL_ASCII, you'll need to recreate it with the correct encoding. See Database Administration for migration steps.

3. Deploy Application

bash
# Create web directory
mkdir -p /var/www/niuton

# Copy or clone the application files
# (Replace with your actual deployment method)
cp -r /path/to/niuton/* /var/www/niuton/

# Set permissions
chown -R www-data:www-data /var/www/niuton
chmod -R 755 /var/www/niuton

# Create required directories
mkdir -p /var/www/niuton/{sessions,logs,cache,temp,userdata}
chown -R www-data:www-data /var/www/niuton/{sessions,logs,cache,temp,userdata}

4. Apache Configuration

bash
# Enable required modules
a2enmod rewrite headers php8.1

# Create VirtualHost
cat > /etc/apache2/sites-available/niuton.conf << 'VHOST'
<VirtualHost *:80>
    ServerName your-domain.net
    DocumentRoot /var/www/niuton

    php_admin_value session.save_path "/var/www/niuton/sessions"
    php_admin_value upload_tmp_dir "/var/www/niuton/temp"
    php_admin_value memory_limit "512M"
    php_admin_value post_max_size "100M"
    php_admin_value upload_max_filesize "100M"

    <Directory /var/www/niuton>
        Options -Indexes +FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>
VHOST

# Enable site and restart
a2ensite niuton.conf
systemctl restart apache2

5. Configure Application

Copy and edit the configuration file:

bash
cp /var/www/niuton/config.example.php /var/www/niuton/config.php
nano /var/www/niuton/config.php

See Configuration for all available options.

6. Initialize Database

Visit your domain in a browser. On first load, Niuton will automatically create the required database tables and prompt you to create an admin account.

For production use, set up Nginx as a reverse proxy in front of Apache for SSL termination. See Deployment for the full Nginx configuration.

AI-Powered Cloud Desktop OS