الانتقال إلى محتوى التوثيق

الترجمة قيد التنفيذ

يتم توفير هذا المستند حالياً باللغة الإنجليزية ريثما تكتمل الترجمة إلى اللغة العربية.

Bare-Metal & VPS Linux Installation

This guide walks through deploying Aqiled directly onto an Ubuntu or Debian server using systemd and local service binaries.

متاح الآن. آخر مراجعة: 26 October 2026.

1. Create System Users and Directories

Run these commands as root to create the unprivileged service user and application directories:

# Create application service user (no login shell)
sudo useradd --system --user-group --home /nonexistent --shell /usr/sbin/nologin school

# Create dedicated directory hierarchy
sudo install -d -o root -g school -m 0750 /opt/school
sudo install -d -o root -g school -m 0750 /opt/school/releases
sudo install -d -o root -g school -m 0750 /opt/school/web
sudo install -d -o root -g root -m 0700 /etc/school
sudo install -d -o root -g root -m 0700 /var/backups/school

2. Publish Backend Application

From your development workstation or build runner, compile the API release:

cd back-end
dotnet publish src/School.Api/School.Api.csproj \
  -c Release \
  -r linux-x64 \
  --no-self-contained \
  -o /tmp/school-api-release

Copy /tmp/school-api-release to the server at /opt/school/releases/v1.0.0, then link it as current:

sudo ln -sfn /opt/school/releases/v1.0.0 /opt/school/current
sudo chown -R root:school /opt/school/releases/v1.0.0

3. Build & Install Dedicated Front-End

In self-hosted dedicated environments, compile the front-end with build:dedicated so that all API requests target relative same-origin paths (/api and /hubs):

cd front-end
npm ci
npm run build:dedicated

Copy the compiled files from dist/dedicated/ to /opt/school/web/current/ on the server:

sudo mkdir -p /opt/school/web/current
sudo cp -r dist/dedicated/* /opt/school/web/current/
sudo chown -R www-data:www-data /opt/school/web/current

4. Install Systemd Service Unit

Create /etc/systemd/system/school-api.service:

[Unit]
Description=Aqiled School Management System API
After=network.target postgresql.service
Requires=postgresql.service

[Service]
Type=simple
User=school
Group=school
WorkingDirectory=/opt/school/current
ExecStart=/usr/bin/dotnet /opt/school/current/School.Api.dll
Restart=always
RestartSec=5
EnvironmentFile=/etc/school/api.env
SyslogIdentifier=school-api

# Security Hardening
ProtectSystem=full
ProtectHome=true
NoNewPrivileges=true
PrivateTmp=true

[Install]
WantedBy=multi-user.target

Reload systemd daemon:

sudo systemctl daemon-reload
sudo systemctl enable school-api.service

5. Next Steps

With your directories, binaries, and service unit installed, proceed to School Provisioning & Single-School Mode to apply database migrations, register your school admin, and start the service.