Old St. Mary's Church, Portsea (now part of Portsmouth), where Lieutenant Stoyle was stationed in 1808 when he wrote this hymn. Isambard Kingdom Brunel was baptized here in 1806, and Charles Dickens in 1812.
The text of this Christmas hymn is first found in the Methodist Magazine for December 1808. The carol is also found in A Selection of Carols, Pieces, and Anthems, Suitable for Christmas (London: W. Kent & Co.; Penzance: F. Rodda, ca. 1860). The author of the text was John Stoyle, a lieutenant in the Royal Navy, sstationed at Portsea, Hampshire. The only other thing I have been able to find out about him was that he made a will in 1821. No tune is specified, but William Knapp's well-known tune "Wareham" seems the kind of thing that would have been used.