The synthesis of living entities in the laboratory is a standing challenge that calls for innovative approaches. Using a cell-free transcription-translation system as a molecular programming platform, we show that the bacteriophage T7, encoded by a 40 kbp DNA program composed of about 60 genes, can be entirely synthesized from its genomic DNA in a test tube reaction. More than a billion infectious bacteriophages T7 per milliliter of reaction are produced after a few hours of incubation. The replication of the genomic DNA occurs concurrently with phage gene expression, protein synthesis, and viral assembly. The demonstration that genome-sized viral DNA can be expressed in a test tube, recapitulating the entire chain of information processing including the replication of the DNA instructions, opens new possibilities to program and to study complex biochemical systems in vitro.