How do I install PHP 7.1 FPM and CLI for Magento 2 to Debian 8 (Jessie)?

How do I install PHP 7.1 FPM and CLI for Magento 2 to Ubuntu 18?