Alliances can declare war on other alliances by posting their declaration in the universe specific diplomacy section of the game forum. Coalitions between alliances or an alliance and players are possible, but don't have to be posted.
Once a war has been declared, 12 hours must pass before the parties can start to bash each other to allow all affected players/alliances to become aware of the war.
War cannot be declared on individual players (or alliances with only one member), it can only be declared on alliances. However, individual players may declare war on an alliance. If a player leaves the alliance they are in, they are no longer part of the war, which means normal bashing rules apply again.