A settlement of the Slavic Drevyane is mentioned in 795, at which a castle and monastery were established in 951. In 1247 the community received its charter as a town, and became a member of the Hanseatic League (an association of trading towns). The development of Lüneburg was made possible by the extraction of salt, which was exported to Burgundy, Eastern Europe and Scandinavia. The saltworks stimulated the later creation of a spa.
Comenius came to Lüneburg in 1647: in August of that year he travelled by ship from Elbląg to Lübeck and thence to Lüneburg, where he visited Jan Stern, the publisher of pietistic books, and discussed the publication of his Elbląg texts.