Keep a clean house. Cockroaches need food and water, so don't leave dirty dishes sitting out, don't leave out pet food, don't leave your garbage exposed and don't leave any sticky messes on countertops. You should also vacuum your entire house, including those nooks and crannies around your electronics, so that cockroach eggs are sucked up before they hatch.
Eliminate their favorite habitats. Remove any cardboard boxes and stacked newspapers. Fix any leaks, especially under sinks, and put escutcheon plates around the plumbing where it enters walls.
Place adhesive traps around your electronics. Put them flush against the wall between your electronics, as cockroaches typically travel along the edges of walls.
Sprinkle the natural cockroach killer, diatomaceous earth, behind your appliances. Diatomaceous earth isn't harmful to humans, but, on the microscopic level, it has razor-sharp edges that cut the exoskeleton of the cockroach, ultimately killing the insect.
Sprinkle catnip around your appliances. Catnip, according to a CBS report, repels cockroaches "100 times better than DEET."