What packages do i need to install on an ubuntu desktop for it to "become a server"?

You can install such server packages on a desktop system using the apt-get tasksel mode (don't forget the final ^):

  • LAMP server (Linux, Apache2, MySQL, PHP)

    sudo apt-get install lamp-server^

  • Mail server

    sudo apt-get install mail-server^

  • OpenSSH server

    sudo apt-get install openssh-server^

Note that you can check which packages are going to be installed using apt-get install --dry-run <name of the task>^ before calling the above commands.