That depends on the location of the lighthouse. If it stood on the coast, there usually was a house nearby for the keeper to stay in. If the lighthouse was on a relatively large island, the house might also be on the island.
On smaller islands, but near the shore, the lighthouse keeper might live closeby on the shore, and take a boat to the lighthouse to service it.
Modern lighthouses also are often unmanned or remotely operated.
ADDED: The more remote lighthouses, or those on very small islands with no extra area for a separate house, had living-accommodation on the ground-floor of the tower itself. It would be no good having the keeper live on shore if he had to attend to an offshore lamp every day, because there would be many times when rough seas would prevent access.
In some cases a "light-ship" was used, usually above shoals on which it was impossible to build a masonry tower. This was a vessel about the size of a deep-sea trawler, fitted with accommodation for the crew, and moored on station. They have been replaced by light-buoys.
a lighthouse keeper
Henry Hall - lighthouse keeper - was born in 1661.
The salary for a lighthouse keeper will vary depending on if the keeper lives in the lighthouse or not. The average salary of a lighthouse keeper is about $167,00 per year.
Henry Blake - lighthouse keeper - died in 1871.
Henry Hall - lighthouse keeper - died in 1755.
James Rankin - lighthouse keeper - was born in 1844.
James Rankin - lighthouse keeper - died in 1921.
Ida Lewis - lighthouse keeper - died in 1911.
Ida Lewis - lighthouse keeper - was born in 1842.
a lighthouse keeper.
A lighthouse keeper.
There hasn't been a lighthouse keeper at Currituck Island Lighthouse since it was automated back in 1939.