Both countries are in the Schengen Zone and in the EU. For these reasons, an ID is enough to travel from one country to another. The ferry operators however always recommend traveling with a passport. Read more about these rules: Germany/Denmark ferry ID requirements.