What do I do wrong to get hip aches after biking? I ride about 17 miles each session. After the ride, the outside of my hips sore: only the parts near the outermost joints, most likely the tendon (although this is only a guess). My knees are fine, my ankles are fine, etc.

The only thing that might not fit perfectly for me is the seat height. I'd rather have a longer post so I can lift the seat up an inch or two. Do you think this might create the soreness in the area of the outer hips?
I have personally experienced that precise symptom, from mountain biking rides or from commuting rides. 

Although I am not sure what causes it, I have observed that when it happens to me, I have ridden up steep inclines in "too high" gears while remaining seated or seated too far back on the saddle. For these reasons I have changed my pedaling technique a bit, using a lot more gearshifts.

I can also recall that my problems appeared when I changed my saddle for a narrower one, so later I found that to accommodate my sit bone, I tended to sit further back, so I could catch a wider part of the saddle. No doubt I changed my saddle's fore/aft position by half an inch towards the front.

In some rare occasions I have gotten hip pain from riding in too tight, non stretching pants, like jeans, specially carrying objects in my pockets. I suspect the problem here is the pressure the clothing excepts over the hip joint while flexing up the leg. Objects like phone, keys or tools in the pockets make this worse.

Check if any of these issues is affecting you and, if you find so, try changing one thing at a time, to see if something helps.