"full of sun," early 14c., from sun (n.) + -y (2). Compare Dutch zonnig, German sonnig. Figurative sense of "cheerful" is attested from 1540s. Sunny side in reference to optimistic outlook is from 1831. Eggs served sunny side up first attested 1887, in lunch counter slang, in reference to appearance when served.
Young Man (in Park Row coffee-and-cake saloon)—Waiter, I want a beefsteak, unpeeled potatoes, and a couple of eggs fried on one side only!
Waiter (vociferously)—"Slaughter in the pan," "a Murphy with his coat on," an' "two white wings with the sunny side up!" [Puck, April 27, 1887]
Related: Sunnily; sunniness. As a noun meaning "sunfish" from 1835.