Installing a custom version of Perl locally


This article walks you through installing a custom version of Perl locally under your username. If your server is currently running Ubuntu 18 (Bionic), the Perl version is 5.26. This article shows how to install a different version if your site requires it.

It's highly recommended that you only use a version of Perl which is currently maintained. This means you should not use a version that has been End-of-Life'd. You can view a full list of versions and their status here:


  1. Log into your server via SSH.
  2. Visit to download your version of Perl. Run the wget command to download the tar.gz file.
    [server]$ wget
  3. Decompress this file.
    [server]$ tar zxf perl-5.18.4.tar.gz
  4. Change into the new directory.
    [server]$ cd perl-5.18.4
  5. Run the configure command for the directory you wish to install into. This example installs into a directory named /opt/perl under your username.
    [server]$ ./Configure -des -Dprefix=$HOME/opt/perl
  6. Run make, make test, and finally make install.
    [server]$ make
    [server]$ make test
    [server]$ make install
  7. Add code to your .bash_profile to find the local version.
    export PATH=$HOME/opt/perl/bin:$PATH
  8. source the .bash_profile.
    [server]$ . ~/.bash_profile
  9. Check to confirm the new version is being used.
    [server]$ perl -v
    This is perl 5, version 18, subversion 4 (v5.18.4) built for x86_64-linux

See also

Did this article answer your questions?

Article last updated PST.

Still not finding what you're looking for?