Ubuntu gallery installation help

Hey, I`ve been tasked to create a gallery on a lamp ubuntu server with no graphical interface.
I`ve managed to setup the server, but I can`t seem to find anywhere how to install gallery programs like gallery2 or coppermine with just the codes. My knowledge with linux server is very very bad, and if someone would give me a step by step or atleast point me to a link would be a great help.