For a solo run the Gunzerker is the best choice due to dual wielding and the ability to refill ammo during the fight. If you are a Gunzerker then make sure to equip two Rocket Launchers. Shotguns and Slag weapons are also very helpful. Slag Grenades are a must have if you want to make this a quick fight. Since Terramorphous deals heavy damage you will probably go down a few times. Kill one of the tentacles while in last stand. This will revive you automatically. When he comes out of the ground quickly throw a bunch of slag grenades and attack with your strongest weapons. His weak spots are shown as yellow glowing dots. Attack them for critical hits. Jump around a lot to dodge incoming attacks from other tentacles. When you stay behind Terramorphous he won't be able to attack you. Always walk in big circles around him and keep some distance.

Video Guide for Side Mission & Boss Fight:

There is another, simpler method of taking out Terramorphous that requires less movement. There is a certain spot to stand that will make you invincible to many of his attacks, but Terramorphous can still hit you in certain occassions. Watch the video below for a better explanation by yoteslaya.