Installing, upgrading and removing StackRegent
StackRegent installs with one PowerShell script on a Windows Server. This article covers the requirements, both ways to install, the installer options, upgrades, removal, and the command-line tools for changing the panel port and resetting the administrator password.
Requirements#
| Item | Requirement |
|---|---|
| Operating system | Windows Server 2016, 2019, 2022 or 2025 (build 14393 or later). Server Core is supported. |
| Rights | PowerShell opened with Run as administrator. |
| Network | Internet access during installation: the installer downloads MariaDB for the panel database, the Visual C++ runtime when it is missing, .NET Framework 4.8 on Windows Server 2016 (restart afterwards to finish it), and the hosting components. |
| Licence | A StackRegent licence key (SR-...). It can also be entered after installation. |
The installer adds the IIS web server role itself. On Server Core the IIS Manager and the Service Monitor tray app are skipped. A non-server edition of Windows gets a warning, because StackRegent is made for Windows Server.
Some features depend on the Windows release: TLS 1.3 for websites and HTTP/3 (off by default) need 2022 or 2025, and the built-in OpenSSH client for Git over SSH needs 2019 or later. The full table is on Tools & Settings › About StackRegent, with your server's release marked.
Install with one command#
On a fresh server, open an elevated PowerShell and run (with your own key):
[Net.ServicePointManager]::SecurityProtocol='Tls12'; & ([scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://panel.stackregent.com/get/stackregent.ps1'))) -LicenseKey SR-XXXXX-XXXXX-XXXXX-XXXXXThe script:
- activates the licence for this server,
- downloads the newest stable StackRegent release from the licence server,
- checks its size, SHA-256 checksum and signature against the StackRegent release key,
- runs
install.ps1from the release.
Nothing is installed if any check fails. You can add -AdminEmail, -Hostname and -Components; they are passed to install.ps1. Add -DownloadOnly to stop after the checks and leave the unpacked release in a temporary folder.
Install from the zip package#
- Extract the whole StackRegent zip on the server.
- Open PowerShell with Run as administrator in the extracted folder.
- Run:
powershell -ExecutionPolicy Bypass -File .\install.ps1 -AdminEmail you@example.comIf you give no -LicenseKey, the installer asks for it; press Enter to enter it later in the panel.
Installer options#
| Option | Default | Meaning |
|---|---|---|
-AdminEmail | empty | Email address of the admin account. |
-LicenseKey | asked | The licence key; it is checked once the panel runs and removed from the install log. |
-Hostname | empty | The panel's host name, used for its Let's Encrypt certificate and mail. |
-Components | recommended | recommended, none, or a comma-separated list of component IDs. |
-HttpsPort | 9443 | Panel HTTPS port. |
-HttpPort | 9080 | Panel HTTP port, which redirects to HTTPS. |
-InstallDir | C:\Program Files\StackRegent | Install folder. |
-DbPort | 8306 | Port of the panel's own database. |
-MariaDBSeries | 11.4 | MariaDB series for the panel database. |
-MariaDBZip | empty | Path to a MariaDB Windows zip, when the download does not work. |
recommended installs URL Rewrite, DNS, FTP, Web Deploy, PHP, MailEnable, Roundcube, MariaDB and phpMyAdmin (IDs urlrewrite, dns, ftp, webdeploy, php, mailenable, roundcube, mariadb-hosting, phpmyadmin). Other IDs you can list include vcredist, aspnetcore, nodejs, iisnode, git, composer, wpcli, mssql and modsecurity. You can add or remove components later under Tools & Settings › Server Components.
What the installer sets up#
- The IIS web server role and the features StackRegent uses.
- The private panel database StackRegent SQL Server (MariaDB,
127.0.0.1:8306only). - The Windows services StackRegent (web panel), StackRegentTask (task runner) and StackRegentGuard (brute-force guard).
- Windows Firewall rules for the panel (9443 and 9080), websites (80 and 443) and Website Preview (9444).
- The StackRegent Service Monitor tray app at administrator logon, with Start menu shortcuts (not on Server Core).
- The hosting components chosen with
-Components.
At the end it prints the panel address, the login admin and its password. Save the password at once: it is not stored anywhere in plain text. The install log is in C:\Program Files\StackRegent\var\log.
Upgrade#
There are two ways:
- In the panel: Tools & Settings › Updates (see the Licensing and updates article).
- By hand: extract the new package and run
install.ps1again. On a server where StackRegent is installed it upgrades in place: it stops the panel services, copies the new binaries, updates the panel database, and starts the services again. Websites keep running.
Uninstall#
install.ps1 copies uninstall.ps1 into the install folder. Run it in an elevated PowerShell:
powershell -ExecutionPolicy Bypass -File "C:\Program Files\StackRegent\uninstall.ps1"It removes the StackRegent services, the panel database service, the StackRegent firewall rules, the Service Monitor task and shortcuts, and the program files. The panel data (mysql-data and etc) is kept unless you add -RemoveData. Hosting components installed through Server Components, such as IIS, MailEnable or MariaDB, are not part of what the script removes.
Change the panel port#
Run on the server, as administrator:
& "C:\Program Files\StackRegent\bin\stackregent.exe" panel-port 8443 [http port]The command:
- accepts ports from 1024 to 65535 and refuses ports in use by websites, Website Preview, FTP, mail, DNS, MariaDB, SQL Server or the panel database, or by another program,
- needs different HTTPS and HTTP ports,
- updates the panel's Windows Firewall rules and restarts the panel service.
Open the new port in any provider firewall too. If you set a custom panel URL under Tools & Settings › Customize Panel URL, change its port as well, or run stackregent panel-url-reset.
Reset the administrator password#
From the login page, click Forgot the password?, enter your login or email and click Send reset link. This needs working outgoing mail and the Password reset option in Interface Management.
On the server you can always set a new password:
& "C:\Program Files\StackRegent\bin\stackregent.exe" admin-passwordIt prints a new generated password for admin. Use admin-password -login <login> for another administrator. The command also switches off two-factor authentication for that login, ends its sessions and clears its failed-login count; turn two-factor authentication on again in Profile & Preferences.
Troubleshooting#
| Problem | What to do |
|---|---|
| "Run this script in PowerShell opened with 'Run as administrator'" | Start PowerShell elevated. |
| MariaDB download fails | Download the MariaDB 11.4 Windows x64 zip yourself and pass -MariaDBZip <path>. |
| "The panel did not answer yet" | Check C:\Program Files\StackRegent\var\log\web.log and Services Management. |
| Locked out by IP Access Restriction | Run stackregent ip-access-reset. |
| Locked out by a firewall change | Run stackregent firewall-reset. |
| Wrong custom panel URL | Run stackregent panel-url-reset. |
| Show the installed version | Run stackregent version. |
Related#
- Getting started
- Licensing and updates
- Server components, PHP and .NET
Something missing? Ask in the community or open a ticket.