Most of the answers here are accepting the question's assumption that a president is in fact necessary in a democracy. As far as I remember from grade school history, a pure democracy is one in which every decision is put to the entire electorate. There is no representation. This is clearly only workable if the electorate is relatively small, as it presumably was in the Greek city states where the term arose.
As with anything learned in grade school, and especially dim memories of the same, that is probably imprecise on the details, but it serves nonetheless to make a point.
Such a democracy surely needs no president of the electorate is sufficiently small. If you have ever tried to get anything done with a group of people, you probably noticed that the more people there are in the group, the more necessary it becomes for someone to direct the group's discussion. It also becomes necessary to designate specific people to take action on the decisions made by the group, that is, to execute those decisions. Often, those roles are merged, but sometimes they are not.
It often makes sense to designate a person or committee to have standing executive authority, rather than spending time assigning action items to different individuals as is common in smaller or less formally organized groups. From that tendency, it is a short step to having a formally organized office or set of offices for a formally organized group.
That explains why countries usually have a head of government, a chief executive. The head of state has a different function, which is to represent the state. For example, if two states are concluding a treaty or other agreement, it is the head of state who represents the state. In practice the authority to do so is usually delegated to diplomats or other officers who negotiate and sign treaties in the name of the head of state. This is in part at a legacy of the feudal era in which monarchs were the state to one degree or another. In those days, a treaty between two countries was a treaty between two people in which the they agreed to bind their heirs and successors.
Heads of state are sometimes given powers that have traditionally lain with monarchs, for example a role in forming and dissolving the legislature, or a role in approving acts of the legislature. Sometimes they have no such function. And sometimes, as in the US, the role is entirely fused with the role of head of government.
So countries, not just democracies, need a head of state for practical reasons to operate on the international stage, and countries with larger decision-making bodies need someone to execute those decisions. These roles need not be filled by one person. Some countries have a "presidency" comprising a committee rather than a unitary "president," for example. And the prime minister of the UK was originally, if I understand correctly, simply the most senior of several ministers who were collectively delegated executive responsibility.
So the answer is: a democracy doesn't need a president to be a democracy, but every country does need a head of state and some sort of executive, and "president" is a title that has been applied to the head of state in various democracies where the role has been anywhere on the spectrum between being a pure ceremonial figurehead and having complete executive authority as combined head of state and head of government.