Crazy, demented, silly, insane, out of control, behaving in a strange way.
Similar phrases are: off one’s trolley, off one’s nut, off one’s head.
This expression has been in use since the mid-1800s. Written examples:
1923 “The Duke is off his rocker.” The Inimitable Jeeves by Wodehouse.
1932 “It’s going to be awkward for us if the Emperor goes off his rocker.” Black Mischief by Evelyn Waugh.
There seems to be three possible sources for this expression.
First is the rocking chair. One supposition is that falling out of your rocking chair would indicate that you are mentally unstable. The second supposition is that the curved pieces of wood (rockers) are not working properly, making the chair behave in a strange way. The analogy can be made to a person whose brain is not working properly, and who thinks in a strange way.
A source which seems more likely to me is the beam engine from the early days of steam engine development. These engines were used in ferry boats and other light water craft, as well as for stationary power — often to pump oil. The beam engine, so I read, rocks back and forth and if it comes off the pivot (rocker) it goes mad, flailing about and smashing up everything around it.
The third source, which also seems reasonable, is the idea that the phrase arose from the invention and construction of trolley lines with overhead wires in the 1890s and which gave rise to the expression, ‘off one’s trolley.’ It was once common to see a trolley driver trying to realign the contact wheel of a trolley car with the overhead wire. Since this contact wheel is also called a trolley, ‘off one’s trolley’ may refer to the fact that when the wires are ‘off the trolley,’ the vehicle no longer receives an electric current and is, therefore, unable to move.
Both ‘off one’s trolley’ and ‘off one’s rocker’ became popular about the same time that streetcars were installed in major American cities. ‘Off one’s trolley is first found in print in 1896, and it was only a year later that ‘off one’s rocker’ appeared.
Since I don’t have a rocking chair, and I don’t ride trolley buses, I just have to hope that the electrical circuits in my brain don’t short out.