As soon as the ground can be worked in the very early spring, you can plant onions if for no other reason than to get your gardener's juices going. Longer days and warmer temperatures trigger onions to begin forming bulbs. The sooner they're in the ground, the larger and better the onions will grow.
Onions require full sun and grow best on raised beds.
But if you don't have raised beds, don't despair. Just add plenty of organic matter to your soil to loosed it up and improve drainage. Onions require a high source of nitrogen. A nitrogen-based fertilizer should be applied about three weeks after planting and then continue side dressing with applications every two to three weeks. It would be a good idea to include some bone meal when preparing the soil as it stimulates early bulb formation and root growth.