In some ways wiring on boats is similar to wiring on RVs, but there are also some very important differences. One that is often overlooked but is very important is the need to use Marine Grade wire in all marine applications. Another is the need to waterproof connections.
Marine grade wire. The high humidity and often, exposure to salt air, demands the wire itself be specially designed for the marine environment. Marine wiring will typically have more, smaller copper strands than automotive wiring of the same gauge. Each strand will also be tinned. Using ordinary copper wiring on a boat is asking for trouble. I had to completely rewire our 24' sailboat because some previous owner had wired it with zip cord! I understand that zip cord is readily available, inexpensive, and easy to work with, but it corrodes way too easily to last very long in a marine environment. That being said it might have already lasted nearly 50 years since my boat was that old so for short temr use it might not be quite such an issue. Virtually all the connections were badly corroded and crumbling. Several connections had literally turned to dust! Fortunately, it didn't cause a fire, but virtually none of the fixtures or connections were functional.
Like RVs, boats may have two or more wiring systems. Power boats will have a wiring system for the engine, including instruments and controls. Small pleasure boats may have a low-voltage (usually 12 or 24 volts) DC system for lights and some communications equipment. Larger boats sometimes use a 48 volt DC system and may have an onboard generator or batteries and an inverter to power 120 volt AC systems to support residential style lights, outlets, and appliances. The 120 volt wiring systems will normally conform to stringent marine codes that are typically an enhancement of residential wiring codes. Older DC systems will probably use red conductors for positive and black conductors for negative lines just like RVs. Because of the potential confusion between black for negative DC and black for hot AC lines, newer marine systems use a yellow conductor for negative DC lines. Of course the electricity doesn't care what color the insulation is so any color wire will carry the current, but the electrician who works on it (whether is is you or someone who comes after you) will care so try to adhere to the normal conventions. It will avoid future problems.
Because boats are often made of wood or fiberglass it is mandatory that every fixture has a ground wire and that the ground connections are clean and secure. A loose or corroded connection will cause performance problems such as dim, intermittent or flickering lights. They might also cause arcing which could cause a fire or, if fuel fumes are present, even an explosion! Land based motor vehicles usually have a metal frame which can serve as a ground, but wooden and fiberglass boats need separate ground wires to every fixture or appliance.
For convenience and a good appearance when running wiring, use multi-conductor cable rather than running 2 or more individual lines. It will be quicker and easier to install and will give a more finished appearance. The additional insulation surrounding the combined conductors also provides extra protection against moisture and abrasions that could cause a short giving an extra measure of safety and longevity.
Like most jobs, having the right tools will make things easier and make better connections. While it is possible to strip insulation from wire using a knife, a wire stripper is faster, safer, and does a better job. If you are using crimp terminals anywhere you will need a wire crimper. I've seen folks try using pliers and it just doesn't work! You really need the indentation crimpers make to form a good connection. Just smashing the two sides of the terminal together with pliers will let the wire slip out if there is ever any tension on the wire at all. A good soldering iron is also very useful. Soldered connections will be sturdier and less susceptible to marine corrosion than crimped connections, making them last longer and less likely come apart or to cause a fire!
If you have a sailboat, I recommend pulling some extra wire through the mast when you have the mast down. Or at least leave yourself a pull string for future use. You may need to install or repair an anchor light or steaming light and it is a LOT easier to pull wire when the mast is down instead of having to climb the mast. You may need to add a light or need to change wires if existing wiring gets damaged. Of course, check all the lights when the mast is down to be sure they will work when you are out on the water. If you plan to add or update any lighting, do it when you have the mast down. The previous owner of my sailboat left an extra pull string in the mast I can use when I need to pull more wire. When I use it I plan to pull another string in case I need one again.
When running wires in the mast you may need to install them in a conduit. This is essential if your halyards are run inside the mast. It also protects the wires against chafing and helps silence noise from the banging around inside the mast. You can also use foam pipe insulation or a pool noodle to cushion the wiring if your halyards run outside that mast. Cushioning is usually most important near each end of the mast where there mounting hardware intrudes where wires could rub.
For added safety and protection against moisture, use heat shrink tubing on all joints. It can even be used on wire nuts to help seal them. Of course, it is better to use soldered connections than wire nuts in a marine environment but there may be some places, like interior cabin lights, where you might want to use wire nuts to facilitate future lighting changes. In many automotive and even RV applications you can get away with using wire nuts or just twisting wires together and wrapping the joint with electrical tape. In a marine environment is is better to solder the joints and secure them with heat shrink tubing. Twisted and taped joints or wire nut connections are more likely to absorb moisture and corrode. You might also seal them with the kind of plastic dip used to coat tool handles. You want to make sure NO moisture gets into the joints!
120 volt AC systems on a boat must always be protected by Equipment Leakage Circuit Interrupters (ELCI) and Ground Fault Circuit Interrupters (GFCI). It doesn't matter whether the power is coming from a shore cable or from on onboard source, such as a generator or battery banks and inverter and/or solar panel. Any failure in the electrical system can put both the people on the boat and any nearby swimmers at risk for their lives! While people on the boat may experience a fatal or non-fatal shock, swimmers could receive a paralyzing dose of electricity and drown immediately due to involuntary loss of muscle control. Even on the soundest boats, water sometimes puddles and creates hazards we don't normally face on land or in RVs. It would always be a good idea to enlist the services or at least seek the advice of a qualified marine electrician when installing or modifying 120 volt electrical components on your boat.
Shore power cords for boats differ from shore power cords for RVs. They have water-proof, twist lock connectors. The twist lock connectors are required to prevent accidental disconnects from movement of the boat while docked. Even when docked boats can move quite a bit due to tides, currents, and wind. You don't want a live power cord falling off into the water! The water-proof requirement is pretty much self-explanatory for something plugged into a receptacle on a dock floating on the water. If a power cord should come disconnected and fall into the water it may cause an electrocution hazard for anyone in contact with the water nearby. Always use extra caution when connecting or disconnection shore power. Any shore power sources SHOULD have their own ELCI and GFCI protection. If they don't, lodge a complaint with the marina and avoid using them until they are brought into compliance.