Deploying on Linux
Container deployment: Deploying with Docker. Windows Server: Deploying on Windows Server.
Release files
The Releases page contains these Linux files:
| File | Architecture | .NET runtime |
|---|---|---|
portway_<version>_amd64.deb |
x64 | Included |
portway_<version>_arm64.deb |
arm64 | Included |
portway-<version>-1.x86_64.rpm |
x64 | Included |
portway-<version>-1.aarch64.rpm |
arm64 | Included |
<tag>-Linux_x64.zip |
x64 | ASP.NET Core Runtime 11 required |
<tag>-Linux_arm64.zip |
arm64 | ASP.NET Core Runtime 11 required |
The .deb packages target Debian and Ubuntu. The .rpm packages target RHEL, Fedora, Rocky Linux and AlmaLinux.
SHA256SUMS contains the SHA-256 checksum of each release file. Verification of the downloaded files:
sha256sum --check --ignore-missing SHA256SUMSPackage installation
1. Install the package
The package installs:
| Path | Contents |
|---|---|
/opt/portway/ |
Application files, appsettings.json, endpoints/, environments/ |
/usr/lib/systemd/system/portway.service |
systemd unit |
portway |
System user that runs the service and owns /opt/portway/ |
2. Set the encryption key
Portway reads PORTWAY_ENCRYPTION_KEY from /opt/portway/.env. Set the key before the first start:
echo "PORTWAY_ENCRYPTION_KEY=$(openssl rand -base64 48)" | sudo tee /opt/portway/.env > /dev/null
sudo chown portway:portway /opt/portway/.env
sudo chmod 600 /opt/portway/.env3. Start the service
The package does not enable or start the service:
sudo systemctl enable --now portway4. Verify
The first start creates tokens/, log/ and auth.db in /opt/portway/. Checks:
curl http://localhost:5000/health/livereturnsAlivehttp://localhost:5000/docsserves the API reference
Listen address
The default listen address is http://localhost:5000. A systemd drop-in sets a different address with ASPNETCORE_URLS:
sudo systemctl edit portway[Service]
Environment=ASPNETCORE_URLS=http://0.0.0.0:8080sudo systemctl restart portwayHTTPS requires a reverse proxy. Nginx and Caddy configuration: Versioning.
Package upgrades
Install the newer package with the command from Package installation. The package restarts a running service.
The package marks appsettings*.json, endpoints/ and environments/ as configuration files:
| Format | Behavior for a modified configuration file |
|---|---|
.deb |
dpkg prompts if the new release changes the file. -o Dpkg::Options::=--force-confold keeps the local file without a prompt. |
.rpm |
rpm keeps the local file and writes the release version as <file>.rpmnew. |
Release notes and backup steps: Upgrading Portway.
Package removal
Removal stops and disables the service. Files created at runtime (auth.db, mcp.db, tokens/, log/, .env) remain in /opt/portway/.
Archive installation
The archive requires the ASP.NET Core Runtime 11.
1. Extract the release
sudo useradd --system --home-dir /opt/portway --shell /usr/sbin/nologin portway
sudo mkdir -p /opt/portway
sudo unzip <tag>-Linux_x64.zip -d /opt/portway
sudo chown -R portway:portway /opt/portway2. Set the encryption key
Identical to step 2 of Package installation.
3. Create the systemd unit
/etc/systemd/system/portway.service:
[Unit]
Description=Portway API gateway
After=network-online.target
Wants=network-online.target
[Service]
User=portway
WorkingDirectory=/opt/portway
ExecStart=/usr/bin/dotnet /opt/portway/PortwayApi.dll
Restart=on-failure
[Install]
WantedBy=multi-user.targetsudo systemctl daemon-reload
sudo systemctl enable --now portwayWorkingDirectory is required: Portway reads and writes auth.db, log/, endpoints/ and environments/ relative to the working directory.
Troubleshooting
Service log:
sudo journalctl -u portway -e| Error | Likely cause | Resolution |
|---|---|---|
PORTWAY_ENCRYPTION_KEY is not set |
Missing .env |
Create /opt/portway/.env (Package installation) |
Permission denied on auth.db or log/ |
Files not owned by portway |
sudo chown -R portway:portway /opt/portway |
Address already in use |
Port taken by another process | Set a different ASPNETCORE_URLS (Listen address) |
You must install or update .NET |
Archive installation without the runtime | Install the ASP.NET Core Runtime 11 |
| Database errors | Invalid connection string | Verify the connection string and SQL Server network access |
| Log | Location |
|---|---|
| Application | /opt/portway/log/portwayapi-*.log |
| Service | journalctl -u portway |
Backup
Back up auth.db, mcp.db, portway.key, .env, .core/, appsettings.overrides.json, environments/, endpoints/ and the file storage directory in /opt/portway/. Upgrades: Upgrading Portway.
Portway