This just doesn't seem dark and mucky enough for a bottom feeder like me!
Trilobite Ecology and Ancient Environments
This page last revised 02 April 2008 by S. M. Gon III

Continental Drift in the Paleozoic Era
Millions of years ago
Click here to go to the PaleoMap Project
This animation of changing continental configurations
courtesy of the PaleoMap Project 
developed by Christopher R. Scotese. 
Half a billion years ago, the Earth's marine environment was certainly not the same as it is today. It is likely that the ocean's chemistry, including salinity, was different, and the configuration of the ocean basins and continents was entirely unlike our modern globe, because of continental drift.

Biotic environments (the living community of plants and animals) were also different. While there were many species of marine plants and animals, many groups prominent today were missing, or poorly represented. For example, in the Cambrian and Ordovician, there were no jawed fishes, and Crustaceans (crabs, shrimps, etc.) which dominate the arthropod fauna of today's oceans, were present, but not prominent.

A view of a Silurian reef (courtesy of the Virtual Silurian Reef) How many trilobites can you find?
Trilobites were among the most prominent of the Paleozoic marine arthropods, and they have only been found in oceanic fossil beds. No freshwater forms have ever been found. They occupied many different ocean environments, from shallow flats and reefs, to deeper ocean bottoms, and even the water column, as floating plankton or free-swimming forms. While a few were wide-ranging pelagic species, most were regional, and their global paleogeography is a fascinating study of how living forms track their changing environments over geological time. Trilobites from different habitats often had specialized forms that were presumably adaptations to their environment.
Trilobite tracks (Cruziana)
courtesy of The Paleo Project

It is thought that the majority of trilobites were bottom-dwellers, crawling on the sea floor, or within complex reefs, acting as roving predators on smaller  invertebrates or as slow scavengers on organic debris.

A Bumastoid trilobite crawling on the benthos. from the Virtual Silurian Reef.

They were able to dig into the bottom sediments in search of food and to conceal themselves from predators. Perhaps some were herbivores on beds of algae (seaweed), or browsers on corals, sponges, or bryozoans. Some may have been filter feeders, orienting with the current and extracting plankton and organic debris.

See related topic: 
Trilobite Feeding Habits
This image of oncocerid nautiloids from the Virtual Silurian Reef

Nautiloids were probably important predators of trilobites. Trilobites certainly were important prey for larger creatures. At first these were large invertebrates, such as predatory worms, nautiloids, sea scorpions (eurypterids), crustaceans, and perhaps Anomalocaridids.  When fishes developed and flourished in the Devonian, we can be sure that trilobites were hard pressed by these new predators. A hard exoskeleton and the ability to enroll protected trilobites from predators and sudden unfavorable environmental changes.

to learn more than you probably want to know, click on me!
This image ©2000 by S. M. Gon III 
created in Macromedia Freehand 8.0
Focus on Anomalocaris: Trilobite bane?
Anomalocaris was the largest predator of the early Cambrian seas. An active, swimming, proto-arthropodan hunter with large eyes and grasping anterior limbs, the fossils of Anomalocaris and related species have been found in Canada, China, and other locations bearing Cambrian age strata. At about half a meter body length it was probably capable of swallowing most trilobites whole, and with a ring-like mouth lined with sharp projections, might have bitten ragged chunks out of prey. Trilobites with wounds attributable to Anomalocaris have been found, but some say the hard exoskeleton of trilobites probably was more than a match for Anomalocaris' mouthparts, which were better suited to ingesting soft worms raked from the mud. 

To the left, I have adapted a reconstruction of Anomalocaris from a 1996 paper by Desmond Collins (J. Paleontology 70(2):280-93) describing the history of speculations and reconstructions of Anomalocaris and Laggania (another Anomalocaridid). Note how the eyes of Anomalocaris could swivel on flexible stalks, offering stereoscopic guidance for the flexible pair of anterior limbs. Each limb was armed with spines with which to grasp and skewer victims. The round mouth is only partially shown under the head, behind the eyes. Large lateral fins probably moved in undulating waves, while rear fins provided stabilizing and turning capabilities.

There is certainly a very wide range of body forms associated with trilobites. There are extremely spiny species, and ones entirely smooth and devoid of spines. There are species (such as the telephinid Opipeuterella shown at left) with huge eyes and narrow bodies that seem adapted to swimming in the pelagic (open ocean) water column. Other species (such as the trinucleid Cryptolithus, shown at right) were eyeless, with wide bodies and supporting structures such as long genal spines, that seem adapted for a dark benthic (ocean bottom) habitat. Some of the speculations on lifestyle and function of body shapes and features may never be clearly confirmed, but what we do know is that trilobites were extremely successful, found in a very wide variety of ocean habitats, and probably occupied many, if not all of the ecological niches that crustaceans do today. That being the case, we know of planktonic, free-swimming, benthic (bottom-dwellers), burrowing, reef-dwelling, and even parasitic crustaceans, and all of these forms have been attributed to trilobites as well. 

stroll with me among the topics below...
Walking Trilobite animation ©2000 by S. M. Gon III