localStorage is just a set of key value pairs, per origin
general perspective, so you need
1. Step one -- find a location to put it
Somewhere to put it. Generally this is some place you can PUT. You may want to put all of our local storage for that app in one place, or you may want to do it like the browser does it, and have one URL for each origin. So you need to decide a location, or let the software help you.
2. Serialize the data
You'll need to iterate though some or all of the keys in local storage. The thing is local storage is a shared space used by apps, bookmarklets, etc. So in most cases you want all fields, but you can imagine some cases that you dont. Linked data is what I like to use most here, because of the network effect, but there's many options. I think as long as you know how to parse it you are OK.
3. A transport layer
One to save, one to load. This is normally just XHR over CORS with the correct content type.
That's the minimal requirements.
Other Considerations:
4. Auth
Many ways to do this, you may not need to, or use OAuth as per remotestorage.js
5. Discovery
Again many methods. This is where the software can help you.
6. Data freedom
e.g. As set out in
http://userdatamanifesto.org/ (notice all unhosted apps must follow this). The main thing I can see here is that the server must be FLOSS.
So I think a heavyweight solution could be remotestorage.js tho you could imagine a simple bookmarklet to be a lite solution ...