Setup PT Magic on Linux - PTMagicians/PTMagic GitHub Wiki
Important: Please do not install PTMagic if you are already running Profit Trailer Feeder. Both tools write to your bot.PROPERTIES files and there may be side effects.
Other Guides
Neomelb created a posting that has instructions on how to setup PT Magic on Ubuntu in Chinese here and Nidkil in English here.
A Rasberry Pi Thread See here.
Quick Start
To run PTMagic on a Linux server you have to install Microsoft .NET. The steps and commands are slightly different for each Linux distribution, so you need to find the instructions that are right for your Linux flavour.
Download and setup .Net 10
sudo apt install -y aspnetcore-runtime-10.0
Or go to https://dotnet.microsoft.com/en-us/download/dotnet/10.0 to download. You'll need:
- .NET Desktop Runtime
- ASP.NET Core Runtime
Verify both required runtimes (Microsoft.NETCore.App & Microsoft.AspNetCore.App) are available:
dotnet --list-runtimes
You shouldn't need to reboot.
Setup PTMagic
-
Create the installation directory:
sudo mkdir -p /var/opt/PTMagic -
Set directory ownership:
sudo chown -R "$USER:$(id -gn)" /var/opt/PTMagic -
Run the updater from Github which installs to
/var/opt/ptmagicby defaultcurl -fsSL https://raw.githubusercontent.com/PTMagicians/PTMagic/master/install-linux.sh | sudo bash
(for a custom directory, change sudo bash to sudo bash -s -- /yourpath/yourdirectory)
Configure PT Magic
If this is a new installation the default files settings.analyzer.json, settings.general.json, and /_presets/Default will be moved into the main folder. If you are updating, all your settings files will remain intact.
After installing, proceed with the setup guide to understand how to configure your installation. You can use nano to edit your configuration files via SSH, or edit them elsewhere and move them to your server.
To start the PTMagic application
cd /var/opt/ptmagic && dotnet PTMagic.dll
To start the monitor
cd /var/opt/ptmagic && dotnet Monitor/Monitor.dll
If something is not working as expected please have a look at our Post-Install Checklist and other wiki pages.
Automate startup with PM2
- Install npm and PM2
sudo apt install -y nodejs npm
sudo npm install -g pm2
- Create a JSON file for PM2
Navigate to your PTMagic installation directory:
cd /var/opt/ptmagic
Create a PM2 startup file for PTMagic Core:
nano pm2-PTM-core.json
Copy and paste the following:
{
"apps": [{
"name": "ptm-core",
"cwd": "/var/opt/ptmagic",
"script": "PTMagic.dll",
"exec_interpreter": "dotnet",
"exec_mode": "fork",
"autorestart": true
}]
}
Create a PM2 startup file for the Monitor:
nano pm2-PTM-monitor.json
Copy and paste the following:
{
"apps": [{
"name": "ptm-monitor",
"cwd": "/var/opt/ptmagic/Monitor",
"script": "Monitor.dll",
"exec_interpreter": "dotnet",
"exec_mode": "fork",
"autorestart": true
}]
}
Replace /var/opt/ptmagic with your installation directory if different.
- Start PTMagic and Monitor
pm2 start pm2-PTM-core.json
pm2 start pm2-PTM-monitor.json
- Automate startup after reboot
pm2 startup
Run the command PM2 displays, then:
pm2 save
- View logs
pm2 logs ptm-core
pm2 logs ptm-monitor