It depends on the server's OS and installed software, on ubuntu 18.0.4 LTS (without any cPanels or Plesks) I just did this:
# apt-get install php-imagick# service php7.2-fpm restart