Yes - soldiers in the UK in barracks etc. (and often on troopships too) will be reported as normal in the ten-yearly census returns.
In the 1871 census it was the Second Battalion that was at Devonport.
In 1875 and 1876 the First Battalion was at Bareilly (India); the Second Battalion was at Shorncliffe and Aldershot for summer drills in 1875, and then at Colchester - until about July 1876.
In 1880 the First Battalion marched to Peshawar and served in the Afghan War on the Khyber line, largely around Landi Kotal. They returned to Peshawar in Mar 1881 and were there at the time of the 1881 census in the UK (or had just left on their way to Rawalpindi). After various places in India they sailed for Egypt in Aug 1884 and were back in the UK in Sep 1885 (Phillips is not mentioned among the officers who served in Egypt).
I've done a bit of a more thorough search in the newspapers, and it does seem as though Samuel Philips was in Colchester c. June 1876 ... 'Lieut. Phillips, 18th Regt.' is mentioned in some cricket results for the Colchester Garrison (in another it's 'G. Phillips, 18th Regt'. - but I wonder if the G is an error). 'Mr S. Phillips, 18th (Royal Irish)' is mentioned as a guest at the Grand Calico Ball at Colchester in Oct 1875, while a 'Mr Phillips, 18th Royal Irish' is a guest at the Ball at the Town Hall, Colchester in Jul 1876. So it does look as though he spent that time in Colchester.
I also see that a 'Lieut. Phillips, 18th Foot' embarked at Portsmouth on the Euphrates for India on 13 Dec 1878.
All this would suggest that he started out with the Second Battalion, and perhaps joined the First Battalion in India in 1878.
Happy to help! I learn stuff too :-)
Best - G