There are many factors to consider when designing your fort.
- Security: Every fort needs some basic security measures. Otherwise you won't survive the first elephant attack, much less a full-blown goblin siege.
- Efficiency: Whether hauling rocks, making a booze run, or just checking the contents of a cabinet, dwarves do a lot of walking. A good fortress layout -- especially the proper placement of workshops and stockpiles -- can significantly reduce the time your dwarves spend walking.
- Aesthetics: Hey, everybody wants a fortress that looks good.
In addition to the considerations above, it's also important to remember that long-term design strategies can easily be disrupted by the discovery of underground terrain features. Don't plan too far ahead, as you might need to adapt to unforeseen obstacles.
Everyone will have their own preferences regarding fortress defense and how to deal with undead, wildlife, hostiles and goblin invaders. Regardless of specifics, it's important to have a plan for dealing with the several different types of inevitable attacks. A few security tips are given below.
Have a way to lock down your fortress. In the event of an attack by hostiles you can't handle, you need a way to lock them out. This can buy you some time while your dwarves prepare their defenses.
For small forts, this could be as simple as placing doors at all the entrances to your fort. Doors can be locked instantly in an emergency. Don't rely on doors alone for security, though, as you'll eventually encounter enemies that can break down doors and pick locks.
For more security, place drawbridges at all the entrances. You don't need a moat; the bridge itself is sufficient since it functions as a wall when raised. Just be sure to connect it to a lever that your dwarves can access quickly and safely in an emergency. Unfortunately, even drawbridges can be rendered inoperable in rare circumstances....
Finally, don't forget about attackers from above and below! Flying attackers might use skylights to bypass your doors and drawbridges. Swimming beasts might crawl up through your well.
Ambushes and thieves can sneak up on your fortress. A party of goblin archers might sneak past your main gate before being spotted, or a kobold could make off with your masterpiece crafts when nobody is looking. The way to avoid these unfortunate events is to use scouts / lookouts.
For small forts, effective scouting could be as simple as tying a war dog (or even a donkey) up near the entrance of your fort. In the event of an ambush the animal will spot the attackers (shortly before dying). If your scouts are far enough from your main gate then you ought to have enough warning to lock down the fort, activate the militia, etc.
When designing your fort, just give some thought to the placement of scouts and be sure to leave room for them.
 Caravan security
Is your trade depot going to be inside or outside your main line of defenses? This is another factor to consider when designing your fort. Although you don't have to protect the traders, their civilizations might hold your fortress responsible for any casualties.
Traps are a great way to protect your fort from small groups of attackers. When designing your fort, think about where you want to place traps. Choke points at major entrances (including entrances to the caverns) make good trap locations. However, be warned that some enemies are immune to traps....
 Staging area
Many players like to design their forts with a militia staging area at the main entrance. Usually this includes placing fortifications (possibly in archer towers), ammunition stockpiles, and cover for your melee dwarves to protect them from approaching archers.
Some players also like to place a training barracks near the entrance to the fort so that the militia can quickly respond to attackers.
Proper placement of stockpiles is key. Almost every workshop job needs raw materials. Is your still near some empty barrels and plants? Does your mason have easy access to stone? A smelter must have quick access to both ore and fuel.
As a general rule of thumb, each workshop should have at least a 3x3 stockpile area associated with it. Some workshops will need more if multiple raw ingredients are needed. An efficient arrangement is to place output stockpiles directly above or below your workshops and connect them with stairs. If you can spare the space, you can carve out a 5x5 room and place the 3x3 workshop in the center, leaving 16 surrounding tiles for input storage.
When utilizing a large storage stockpile, for food or wood for example, the optimal approach is to place a small stockpile next to the workshop and have the small stockpile "take" from the large stockpile.
There are a few other things to consider for basic fortress efficiency:
- Major hallways should be at least two tiles wide, preferably three tiles. Otherwise your dwarves will be constantly running into each other and productivity will be slowed.
- To reduce the amount of time that your dwarves spend walking, common areas should be placed near the center of your fort. Dwarves drink frequently. They also like to throw parties. It's a good idea to store your booze in a centralized location, and to designate a meeting hall in a similarly centralized place.
- An efficient fortress must make good use of all three dimensions. A dwarf climbs or descends one z-level in the same time it takes to move one step horizontally. For example, when you need to build more bedrooms it can be a lot more efficient to dig down one level than to place the new rooms 20 tiles farther from the center of your fortress.
- Moving one step diagonally takes about 1.4 times longer than moving one step orthogonally. This matches the real world, where Pythagoras tells us that it should take about √2 (1.414) times longer. You can optimize floor plans for pathfinding by adopting more circular shapes into your design.
- With burrows, it is possible to keep some dwarves working in a specific area, so that they never try to take a task half-way across the map, or haul items a long distance through high-volume corridors. For example, you might keep your furnace operators and your weaponsmiths hard at work in their smelters and forges by designating a burrow for them. Make sure you understand burrows before attempting this - if there is no source of food or drink in the burrows a dwarf is restricted to, you may run into some problems. Also make sure the dwarves' quarters (or at least a dormitory) are inside the burrow.
Aesthetics are completely subjective, of course, but it's still something you may want to consider when designing your fort.
- Symmetry is often the easiest path to visual appeal, but it may be hard to balance with function. Asymmetry can look great but requires more skill to look graceful.
- Conform to either mostly organic shapes or mostly inorganic shapes. A mixture probably won't look very good.
- Try digging passages out of stone rather than soil. Although digging in stone is slower and messier, stone can eventually be smoothed and engraved, and yields a useable material. Soil, on the other hand, is ugly and much less dwarfy (although being excessive and paving stone over everything is arguably more dwarfy).
- Use stockpile settings to consistently build your furniture from a single type of stone. Bedrooms tend to look nicer when the furniture is uniform.
- Alternatively, if you like lots of color and variety, you can use the stockpile and workshop settings to make sure your dwarves use lots of different materials.
 Further Reading
For an in-depth examination of topics relating to fortress layout, these pages focus on specific aspects, mostly with an eye to improving survivability. Some of these are not directly related to architecture but are useful nonetheless.