All the code in the OpenStreeMap project is open source and you can create your own OSM server by installing the [rails port][1]. This contains the front end, the api and potlatch. It does not include the tile generator (mapnik) ([mapnik][2]), the searching ([nominatim][3]) or the searching (nominatim).
extended API.
I am currently running this on my laptop, without the whole planet imported.
Note that this will be your own seperate private map based on OSM software. You can import OSM data to your database, database or part of it, even continuasly. But you may get problems with colliding id if you commit to your own database and then import updates from the central database.
[1]: http://wiki.openstreetmap.org/wiki/Rails_porthttp://wiki.openstreetmap.org/wiki/Rails_port
[2]: http://wiki.openstreetmap.org/wiki/Mapnik
[3]: http://wiki.openstreetmap.org/wiki/Nominatim