If you running
If you are using runcloud.io for your server it’s very easy
if your website is running PHP 7.2 you can install ImageMagick
apt-get install php72rc-pecl-imagick
For other PHP version change accordingly php56, php70 or php73
For Ghostscript you can install with
apt-get update apt-get install ghostscript ghostscript -v